add terraform apply jobs

hyuckhoon.ko·2021년 1월 1일
0

What I learned in first year

목록 보기
33/146
  • 수정 전
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"

0개의 댓글