added after_deploy step to travis.yml; updated string generation yet again

This commit is contained in:
Scott Nowicki 2017-04-19 19:29:36 -05:00
parent 4fb55b0c5e
commit e0208f48ba
2 changed files with 6 additions and 3 deletions

View File

@ -23,3 +23,7 @@ deploy:
on:
repo: 10thmagnitude/terraform
branch: topic-101-vm-simple-linux
after_deploy:
- provider: script
script: terraform destroy

View File

@ -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
#