From e0208f48ba9260552cdefcd21c507e90ecfbd38e Mon Sep 17 00:00:00 2001 From: Scott Nowicki Date: Wed, 19 Apr 2017 19:29:36 -0500 Subject: [PATCH] added after_deploy step to travis.yml; updated string generation yet again --- .travis.yml | 4 ++++ examples/azure-vm-simple-linux/deploy.sh | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 06fa72134..874e22b95 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,3 +23,7 @@ deploy: on: repo: 10thmagnitude/terraform branch: topic-101-vm-simple-linux + +after_deploy: + - provider: script + script: terraform destroy diff --git a/examples/azure-vm-simple-linux/deploy.sh b/examples/azure-vm-simple-linux/deploy.sh index c6f9bc55e..2c54a94ca 100755 --- a/examples/azure-vm-simple-linux/deploy.sh +++ b/examples/azure-vm-simple-linux/deploy.sh @@ -4,7 +4,8 @@ set -o errexit -o nounset # generate a unique string for CI deployment KEY=$(cat /dev/urandom | tr -cd 'a-z' | head -c 8) -KEY+=$(cat /dev/urandom | tr -cd '0-9' | head -c 8) +KEY+=$(cat /dev/urandom | tr -cd 'A-Z' | head -c 4) +KEY+=$(cat /dev/urandom | tr -cd '0-9' | head -c 4) PASSWORD=KEY+"#" terraform get @@ -21,8 +22,6 @@ terraform apply out.tfplan # TODO: determine external validation, possibly Azure CLI -terraform destroy - # echo "Setting git user name" # git config user.name $GH_USER_NAME #