Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version: 2.1
- executors:
- default:
- working_directory: ~/aws-terraform
- docker:
- - image: hashicorp/terraform:light
- commands:
- install_tfnotify:
- steps:
- - run:
- name: install tfnotify
- command: |
- apk --update add go libc-dev
- go get -u -v github.com/mercari/tfnotify
- jobs:
- plan:
- executor:
- name: default
- steps:
- - checkout
- - install_tfnotify
- - run:
- name: Init terraform
- command: terraform init
- - run:
- name: Validate terraform
- command: terraform validate
- - run:
- name: Plan terraform
- command: terraform plan | /root/go/bin/tfnotify plan
- deploy:
- executor:
- name: default
- steps:
- - checkout
- - install_tfnotify
- - run:
- name: Init terraform
- command: terraform init
- - run:
- name: Apply terraform
- command: terraform apply -auto-approve | /root/go/bin/tfnotify apply
- destroy:
- executor:
- name: default
- steps:
- - checkout
- - install_tfnotify
- - run:
- name: Init terraform
- command: terraform init
- - run:
- name: destroy terraform
- command: terraform destroy -auto-approve
- workflows:
- version: 2
- plan-and-deploy:
- jobs:
- - plan
- - hold:
- type: approval
- requires:
- - plan
- filters:
- branches:
- only: master
- - deploy:
- requires:
- - plan
- filters:
- branches:
- only: master
- - destroy:
- requires:
- - deploy
- filters:
- branches:
- only: master
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement