mirror of
https://gitlab.sarex.io/infra/terraform-contour-mirror.git
synced 2026-08-05 18:31:00 +03:00
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+)
This commit is contained in:
parent
d2527c60aa
commit
0d0075e506
@ -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\"'"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user