Created
August 10, 2017 18:07
-
-
Save undeadops/b14d5dcba3ae91d82f5d84147c1337a0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 2.0 | |
jobs: | |
build: | |
working_directory: ~/knex | |
docker: | |
- image: hashicorp/terraform:0.10.0 | |
steps: | |
- checkout | |
- run: | |
name: Initialize terraform | |
command: 'terraform init' | |
- run: | |
name: Fetch Terraform Statefile | |
command: 'terraform get' | |
- run: | |
name: Validate Terraform Config | |
command: 'terraform validate' | |
test: | |
working_directory: ~/knex | |
docker: | |
- image: hashicorp/terraform:0.10.0 | |
steps: | |
- checkout | |
- run: | |
name: Plan Terraform Deployment | |
command: 'terraform plan -out=terraform.plan' | |
deploy: | |
docker: | |
- image: hashicorp/terraform:0.10.0 | |
steps: | |
- checkout | |
- deploy: | |
command: | | |
if [ "${CIRCLE_BRANCH}" == "master" ]; | |
then terraform apply terraform.plan; | |
fi | |
workflows: | |
version: 2 | |
build_and_test: | |
jobs: | |
- build | |
- test: | |
requires: | |
- build | |
- hold: | |
type: approval | |
requires: | |
- build | |
- test | |
- deploy: | |
requires: | |
- hold | |
filters: | |
branches: | |
only: master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment