mirror of
https://gitlab.sarex.io/infra/terraform-contour-mirror.git
synced 2026-08-08 21:21:34 +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'
|
cat > "$OUTPUT_FILE" << 'HEADER'
|
||||||
workflow:
|
workflow:
|
||||||
rules:
|
rules:
|
||||||
- if: '$CI_PIPELINE_SOURCE == "pipeline"'
|
- when: always
|
||||||
- if: '$CI_PIPELINE_SOURCE == "parent_pipeline"'
|
|
||||||
- if: '$CI_PIPELINE_SOURCE == "trigger"'
|
|
||||||
- if: '$CI_COMMIT_BRANCH'
|
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
AWS_EC2_METADATA_DISABLED: "true"
|
AWS_EC2_METADATA_DISABLED: "true"
|
||||||
@ -61,11 +58,14 @@ find live -name "terragrunt.hcl" -not -path "*/.terragrunt-cache/*" | sort | whi
|
|||||||
if [ "$env" = "prod" ]; then
|
if [ "$env" = "prod" ]; then
|
||||||
runner_tags=" tags:
|
runner_tags=" tags:
|
||||||
- prod"
|
- 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\"'"
|
- if: '\$CI_PIPELINE_SOURCE == \"pipeline\" && \$TARGET_ENV == \"prod\"'"
|
||||||
else
|
else
|
||||||
runner_tags=""
|
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 == \"stage\"'
|
||||||
- if: '\$CI_COMMIT_BRANCH =~ /^feature\\\\/.*/'
|
- if: '\$CI_COMMIT_BRANCH =~ /^feature\\\\/.*/'
|
||||||
- if: '\$CI_PIPELINE_SOURCE == \"pipeline\" && \$TARGET_ENV == \"stage\"'"
|
- if: '\$CI_PIPELINE_SOURCE == \"pipeline\" && \$TARGET_ENV == \"stage\"'"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user