Skip to content

Instantly share code, notes, and snippets.

@chrislewisdev
Created October 4, 2017 07:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrislewisdev/990bed385118e2082976b872a35c8971 to your computer and use it in GitHub Desktop.
Save chrislewisdev/990bed385118e2082976b872a35c8971 to your computer and use it in GitHub Desktop.
notifications:
email: false
#Install a Terraform executable locally
before_install:
- wget https://releases.hashicorp.com/terraform/0.10.6/terraform_0.10.6_linux_amd64.zip
- unzip terraform_0.10.6_linux_amd64.zip
#These two steps will effectively validate our terraform and output a list of any changes to be made to our infrastructure
script:
- ./terraform init
- ./terraform plan
deploy:
#Roll out any terraform changes required
- provider: script
script:
- ./terraform apply
skip_cleanup: true
on:
branch: master
#Upload our website contents to the S3 bucket that terraform created
- provider: s3
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
bucket: "hello-world.com"
region: "ap-southeast-2"
local_dir: website
on:
branch: master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment