From 0d0075e506e6c15a0d025d2eee6e6c65c7f6bbd9 Mon Sep 17 00:00:00 2001 From: Kochetkov S Date: Tue, 3 Feb 2026 13:40:57 +0300 Subject: [PATCH] fix(ci): simplify workflow and add parent_pipeline source - Use 'when: always' for child pipeline workflow - Add parent_pipeline source check to job rules (GitLab 15+) --- scripts/generate-pipeline.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/generate-pipeline.sh b/scripts/generate-pipeline.sh index 04e67d4..c4dcc1b 100755 --- a/scripts/generate-pipeline.sh +++ b/scripts/generate-pipeline.sh @@ -6,10 +6,7 @@ OUTPUT_FILE=".gitlab-ci.generated.yml" cat > "$OUTPUT_FILE" << 'HEADER' workflow: rules: - - if: '$CI_PIPELINE_SOURCE == "pipeline"' - - if: '$CI_PIPELINE_SOURCE == "parent_pipeline"' - - if: '$CI_PIPELINE_SOURCE == "trigger"' - - if: '$CI_COMMIT_BRANCH' + - when: always variables: AWS_EC2_METADATA_DISABLED: "true" @@ -61,11 +58,14 @@ find live -name "terragrunt.hcl" -not -path "*/.terragrunt-cache/*" | sort | whi if [ "$env" = "prod" ]; then runner_tags=" tags: - prod" - branch_rules=" - if: '\$CI_COMMIT_BRANCH == \"master\"' + branch_rules=" - if: '\$CI_PIPELINE_SOURCE == \"parent_pipeline\"' + - if: '\$CI_COMMIT_BRANCH == \"master\"' - if: '\$CI_PIPELINE_SOURCE == \"pipeline\" && \$TARGET_ENV == \"prod\"'" else runner_tags="" - branch_rules=" - if: '\$CI_PIPELINE_SOURCE == \"merge_request_event\"' + branch_rules=" - if: '\$CI_PIPELINE_SOURCE == \"parent_pipeline\"' + - if: '\$CI_PIPELINE_SOURCE == \"pipeline\"' + - if: '\$CI_PIPELINE_SOURCE == \"merge_request_event\"' - if: '\$CI_COMMIT_BRANCH == \"stage\"' - if: '\$CI_COMMIT_BRANCH =~ /^feature\\\\/.*/' - if: '\$CI_PIPELINE_SOURCE == \"pipeline\" && \$TARGET_ENV == \"stage\"'"