terraform/.travis.yml

29 lines
764 B
YAML

language: generic
# establish environment variables
env:
- TEST_DIR=examples/azure-vm-simple-linux
branches:
only:
- /^(?i:topic)-.*$/
# install terraform
before_deploy:
- curl -fSL "https://releases.hashicorp.com/terraform/0.9.3/terraform_0.9.3_linux_amd64.zip" -o terraform.zip
- sudo unzip terraform.zip -d /opt/terraform
- sudo ln -s /opt/terraform/terraform /usr/bin/terraform
- rm -f terraform.zip
# terraform deploy script
deploy:
- provider: script
skip_cleanup: true
script: cd $TEST_DIR && chmod +x ./deploy.sh && ./deploy.sh
on:
repo: 10thmagnitude/terraform
branch: topic-101-vm-simple-linux
# TODO: possibly use Azure CLI to delete the resource group
after_deploy: cd $TEST_DIR && terraform destroy -force