terraform/examples/azure-vmss-ubuntu/deploy.ci.sh

35 lines
1.2 KiB
Bash
Raw Normal View History

provider/azurerm: Example of VM Scale Set with Ubuntu (#15290) * initial commit - 101-vm-from-user-image * changed branch name * not deploying - storage problems * provisions vm but image not properly prepared * storage not correct * provisions properly * changed main.tf to azuredeploy.tf * added tfvars and info for README * tfvars ignored and corrected file ext * added CI config; added sane defaults for variables; updated deployment script, added mac specific deployment for local testing * deploy.sh to be executable * executable deploy files * added CI files; changed vars * prep for PR * removal of old folder * prep for PR * wrong args for travis * more PR prep * updated README * commented out variables in terraform.tfvars * Topic 101 vm from user image (#2) * initial commit - 101-vm-from-user-image * added tfvars and info for README * added CI config; added sane defaults for variables; updated deployment script, added mac specific deployment for local testing * prep for PR * added new template * oops, left off master * prep for PR * correct repository for destination * renamed scripts to be more intuitive; added check for docker * merge vm simple; vm from image * initial commit * deploys locally * updated deploy * changed to allow http & https (like ARM tmplt) * changed host_name & host_name variable desc * merge master * added new constructs/naming for deploy scripts, etc. * suppress az login output * merge of CI config * prep for PR * took out armviz button and minor README changes * changed host_name * fixed merge conflicts * changed host_name variable * updating Hashicorp's changes to merged simple linux branch * updating files to merge w/master and prep for Hashicorp pr * Revert "updating files to merge w/master and prep for Hashicorp pr" This reverts commit b850cd5d2a858eff073fc5a1097a6813d0f8b362. * Revert "updating Hashicorp's changes to merged simple linux branch" This reverts commit dbaf8d14a9cdfcef0281919671357f6171ebd4e6. * work in progress; waiting on support for lb inbound nat & autoscale settings * changing .travis.yml for this branch * updated deploy validation; readme; travis.yml * in progress; lb inbound nat pool id argument added * deploys vmss, not autoscale (no resource) * merging hashicorp master into this branch * chmod for deploy scripts * cleaned up main.tf * ran tf fmt * fixed typo in travis.yml * pinning azuresdk/azure-cli-python version * typo * adding comments * provisions withouth autoscale * fixed clean up to destroy rg * renamed example directory * reverted to Hashicorp's travis.yml * merge conflict - return line * merge conflict - white space * updated README
2017-06-15 18:28:11 +02:00
#!/bin/bash
set -o errexit -o nounset
docker run --rm -it \
-e ARM_CLIENT_ID \
-e ARM_CLIENT_SECRET \
-e ARM_SUBSCRIPTION_ID \
-e ARM_TENANT_ID \
-v $(pwd):/data \
--entrypoint "/bin/sh" \
hashicorp/terraform:light \
-c "cd /data; \
/bin/terraform get; \
/bin/terraform validate; \
/bin/terraform plan -out=out.tfplan -var admin_username=$KEY -var hostname=$KEY -var vmss_name=$KEY -var resource_group=$KEY -var admin_password=$PASSWORD; \
/bin/terraform apply out.tfplan"
# cleanup deployed azure resources via azure-cli
docker run --rm -it \
azuresdk/azure-cli-python:0.2.10 \
sh -c "az login --service-principal -u $ARM_CLIENT_ID -p $ARM_CLIENT_SECRET --tenant $ARM_TENANT_ID > /dev/null; \
az resource list -g $KEY;"
# cleanup deployed azure resources via terraform
docker run --rm -it \
-e ARM_CLIENT_ID \
-e ARM_CLIENT_SECRET \
-e ARM_SUBSCRIPTION_ID \
-e ARM_TENANT_ID \
-v $(pwd):/data \
--workdir=/data \
--entrypoint "/bin/sh" \
hashicorp/terraform:light \
-c "/bin/terraform destroy -force -var resource_group=$KEY -var admin_username=$KEY -var hostname=$KEY -var vmss_name=$KEY -var admin_password=$PASSWORD;"