github.com/nathanielks/terraform@v0.6.1-0.20170509030759-13e1a62319dc/examples/azure-cdn-with-storage-account/deploy.ci.sh (about)

     1  #!/bin/bash
     2  
     3  set -o errexit -o nounset
     4  
     5  docker run --rm -it \
     6    -e ARM_CLIENT_ID \
     7    -e ARM_CLIENT_SECRET \
     8    -e ARM_SUBSCRIPTION_ID \
     9    -e ARM_TENANT_ID \
    10    -v $(pwd):/data \
    11    --workdir=/data \
    12    --entrypoint "/bin/sh" \
    13    hashicorp/terraform:light \
    14    -c "/bin/terraform get; \
    15        /bin/terraform validate; \
    16        /bin/terraform plan -out=out.tfplan -var resource_group=$KEY; \
    17        /bin/terraform apply out.tfplan"
    18  
    19  # cleanup deployed azure resources via terraform
    20  docker run --rm -it \
    21    -e ARM_CLIENT_ID \
    22    -e ARM_CLIENT_SECRET \
    23    -e ARM_SUBSCRIPTION_ID \
    24    -e ARM_TENANT_ID \
    25    -v $(pwd):/data \
    26    --workdir=/data \
    27    --entrypoint "/bin/sh" \
    28    hashicorp/terraform:light \
    29    -c "/bin/terraform destroy -force -var resource_group=$KEY;"