add branch workflow

This commit is contained in:
Work 2026-01-28 16:07:08 +03:00
parent 1856c310ca
commit ae30445723
2 changed files with 6 additions and 12 deletions

View File

@ -17,8 +17,7 @@ generate-pipeline:
expire_in: 1 hour
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "main"'
- if: '$CI_COMMIT_BRANCH =~ /^feature\/.*/'
- if: '$CI_COMMIT_BRANCH == "stage"'
trigger-downstream:
stage: trigger
@ -43,5 +42,4 @@ trigger-downstream:
AWS_SECRET_ACCESS_KEY: ${S3_SECRET_KEY}
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "main"'
- if: '$CI_COMMIT_BRANCH =~ /^feature\/.*/'
- if: '$CI_COMMIT_BRANCH == "stage"'

View File

@ -73,8 +73,7 @@ validate-${job_prefix}:
- terragrunt validate
rules:
- if: '\$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '\$CI_COMMIT_BRANCH == "master" || \$CI_COMMIT_BRANCH == "main"'
- if: '\$CI_COMMIT_BRANCH =~ /^feature\/.*/'
- if: '\$CI_COMMIT_BRANCH == "stage"'
- if: '\$CI_PIPELINE_SOURCE == "pipeline"'
interruptible: true
artifacts:
@ -114,9 +113,8 @@ plan-${job_prefix}:
- terragrunt init -upgrade -reconfigure
- terragrunt plan -out=tfplan
rules:
- if: '\$CI_COMMIT_BRANCH == "master" || \$CI_COMMIT_BRANCH == "main"'
- if: '\$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '\$CI_COMMIT_BRANCH =~ /^feature\/.*/'
- if: '\$CI_COMMIT_BRANCH == "stage"'
- if: '\$CI_PIPELINE_SOURCE == "pipeline"'
interruptible: true
artifacts:
@ -158,11 +156,9 @@ apply-${job_prefix}:
- terragrunt init -upgrade -reconfigure
- terragrunt apply -auto-approve
rules:
- if: '\$CI_COMMIT_BRANCH == "master" || \$CI_COMMIT_BRANCH == "main"'
- if: '\$CI_COMMIT_BRANCH == "stage"'
when: ${when_clause}
- if: '\$CI_COMMIT_BRANCH =~ /^feature\/.*/'
when: ${when_clause}
- if: '\$CI_PIPELINE_SOURCE == "pipeline"'
- if: '\$CI_PIPELINE_SOURCE == "pipeline" && \$CI_COMMIT_BRANCH == "stage"'
when: ${when_clause}
interruptible: true