-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathteardown-infra-pipelines.yml
34 lines (30 loc) · 1.22 KB
/
teardown-infra-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
trigger: none
pool:
vmImage: ubuntu-latest
variables:
- group: az-credentials
steps:
- script: |
terraform init -backend-config=backend.tfvars
workingDirectory: $(Build.SourcesDirectory)/infrastructure/environments/dev
displayName: Terraform Init
env:
ARM_CLIENT_ID: $(ARM_CLIENT_ID)
ARM_CLIENT_SECRET: $(ARM_CLIENT_SECRET)
ARM_SUBSCRIPTION_ID: $(ARM_SUBSCRIPTION_ID)
ARM_TENANT_ID: $(ARM_TENANT_ID)
- script: |
terraform destroy -auto-approve -var-file=variables.tfvars \
-var "dns={\"custom_domain_verification_id\":\"$CUSTOM_DOMAIN_VERIFICATION_ID\"}" \
-var "app_secrets={\"docker_registry_password\":\"$DOCKER_REGISTRY_PASSWORD\"}" \
-var "database_credentials={\"admin_username\":\"$DB_ADMIN_USERNAME\", \"admin_password\":\"$DB_ADMIN_PASSWORD\"}"
workingDirectory: $(Build.SourcesDirectory)/infrastructure/environments/dev
displayName: Terraform Destroy (ignores drift)
env:
ARM_CLIENT_ID: $(ARM_CLIENT_ID)
ARM_CLIENT_SECRET: $(ARM_CLIENT_SECRET)
ARM_SUBSCRIPTION_ID: $(ARM_SUBSCRIPTION_ID)
ARM_TENANT_ID: $(ARM_TENANT_ID)
DOCKER_REGISTRY_PASSWORD: $(DOCKER_REGISTRY_PASSWORD)
DB_ADMIN_USERNAME: $(DB_ADMIN_USERNAME)
DB_ADMIN_PASSWORD: $(DB_ADMIN_PASSWORD)