-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathazure-destroy-prod.yml
37 lines (35 loc) · 1.05 KB
/
azure-destroy-prod.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
35
36
37
variables:
# Azure Service Principal alias name
azureSubscription: 'nodejs-cicd'
stages:
- stage: destroy
jobs:
- job: destroy
continueOnError: false
steps:
- task: TerraformInstaller@0
displayName: 'install'
inputs:
terraformVersion: latest
- task: TerraformCLI@0
displayName: 'init'
inputs:
backendType: azurerm
command: init
backendServiceArm: $(azureSubscription)
backendAzureRmResourceGroupName: 'nodejs-cicd-rg'
backendAzureRmStorageAccountName: 'tfops'
backendAzureRmContainerName: 'tfstate'
backendAzureRmKey: tfstate.tfstate
- task: TerraformCLI@0
displayName: select workspace prod
inputs:
command: workspace
workspaceSubCommand: select
workspaceName: prod
- task: TerraformCLI@0
displayName: 'destroy'
inputs:
backendType: azurerm
command: 'destroy'
environmentServiceName: $(azureSubscription)