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\"'"