From ae30445723222c08717972a379699fc9b3797777 Mon Sep 17 00:00:00 2001 From: Work Date: Wed, 28 Jan 2026 16:07:08 +0300 Subject: [PATCH] add branch workflow --- .gitlab-ci.yml | 6 ++---- scripts/generate-pipeline.sh | 12 ++++-------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 17b9bd6..66a512a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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"' diff --git a/scripts/generate-pipeline.sh b/scripts/generate-pipeline.sh index 00cd919..467f7bd 100755 --- a/scripts/generate-pipeline.sh +++ b/scripts/generate-pipeline.sh @@ -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