Staging Apply:
stage: Staging Apply
script:
- echo "Run Terraform Apply for Staging"
rules:
- if: '$CI_COMMIT_BRANCH =~ /^(master|production)$/'
Staging Apply:
stage: Staging Apply
script:
- cd deploy/
- export TF_VAR_ecr_image=$ECR_REPO:$CI_COMMIT_SHORT_SHA
- terraform init
- terraform workspace select staging
- terraform apploy -auto-approve
rules:
- if: '$CI_COMMIT_BRANCH =~ /^(master|production)$/'
Production Apply 부분도 수정한다.
Production Apply:
stage: Production Apply
script:
- cd deploy/
- export TF_VAR_ecr_image=$ECR_REPO:$CI_COMMIT_SHORT_SHA
- terraform init
- terraform workspace select production
- terraform apploy -auto-approve
rules:
- if: '$CI_COMMIT_BRANCH == "production"