terraform/.travis.yml

32 lines
843 B
YAML
Raw Normal View History

sudo: required
services:
- docker
language: generic
2017-03-13 23:07:10 +01:00
# establish environment variables
2017-03-13 23:07:10 +01:00
env:
- TEST_DIR=examples/azure-vm-simple-linux
2017-03-13 23:07:10 +01:00
2015-01-22 21:57:01 +01:00
branches:
only:
- /^(?i:topic)-.*$/
# install terraform
before_deploy:
- KEY=$(cat /dev/urandom | tr -cd 'a-z' | head -c 12)
- PASSWORD=$KEY$(cat /dev/urandom | tr -cd 'A-Z' | head -c 2)$(cat /dev/urandom | tr -cd '0-9' | head -c 2)
2017-04-19 17:51:07 +02:00
# terraform deploy script
deploy:
- provider: script
skip_cleanup: true
2017-04-20 20:44:23 +02:00
script: cd $TEST_DIR && ./deploy.sh $KEY $PASSWORD
on:
repo: 10thmagnitude/terraform
2017-04-19 17:51:07 +02:00
branch: topic-101-vm-simple-linux
# TODO: possibly use Azure CLI to delete the resource group
2017-04-20 20:44:23 +02:00
# after_deploy: docker run --rm -it azuresdk/azure-cli-python "az login --service-principal -u $ARM_CLIENT_ID -p $ARM_CLIENT_SECRET --tenant $ARM_TENANT_ID && az group delete $KEY"