limnh / journey

Notes and learnings along the way of becoming an engineer
0 stars 1 forks source link

Get CircleCI "Apply" to run #12

Closed esacteksab closed 5 years ago

esacteksab commented 5 years ago

Given terraform init or terraform plan runs on staging/PR, we need terraform apply to run on Master (merge to master). Make the necessary changes to .circle/config.yaml so that it runs terraform apply with the plan created in the previous steps/stages.

limnh commented 5 years ago

has been successfully implemented with the following code:

  steps:
    - *restore_repo
    - *set_terraform_environment
    - *terraform_init
    - attach_workspace:
        at: *working_directory
    - run:
        name: terraform apply
        command: |
          source $BASH_ENV
          pwd
          ls -al
          cd packet/builder && terraform apply --auto-approve terraform.plan

additional context available in #14