-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
84 lines (83 loc) · 2.08 KB
/
azure-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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
trigger:
branches:
include:
- main
paths:
include:
- docs
exclude:
- docs/test.txt
- README.md
pr:
branches:
include:
- main
paths:
include:
- docs
exclude:
- docs/test.txt
- README.md
pool:
vmImage: ubuntu-18.04
stages:
- stage: validate
jobs:
- job: validate
continueOnError: false
steps:
- task: TerraformInstaller@0
displayName: 'install'
inputs:
terraformVersion: '0.12.3'
- task: TerraformTaskV2@2
displayName: 'init'
inputs:
provider: 'azurerm'
command: 'init'
backendServiceArm: 'azure-spn'
backendAzureRmResourceGroupName: 'terraform-rg'
backendAzureRmStorageAccountName: 'asktfaccount'
backendAzureRmContainerName: 'asktfcontainer'
backendAzureRmKey: 'terraform.tfsate'
- task: TerraformTaskV2@2
displayName: 'validate'
inputs:
provider: 'azurerm'
command: 'validate'
- stage: deploy
jobs:
- deployment: deploy_terraform
continueOnError: false
environment: 'dev'
strategy:
runOnce:
deploy:
steps:
- checkout: self
- task: TerraformInstaller@0
displayName: 'install'
inputs:
terraformVersion: '0.12.3'
- task: TerraformTaskV2@2
displayName: 'init'
inputs:
provider: 'azurerm'
command: 'init'
backendServiceArm: 'azure-spn'
backendAzureRmResourceGroupName: 'terraform-rg'
backendAzureRmStorageAccountName: 'asktfaccount'
backendAzureRmContainerName: 'asktfcontainer'
backendAzureRmKey: 'terraform.tfstate'
- task: TerraformTaskV2@2
displayName: 'plan'
inputs:
provider: 'azurerm'
command: 'plan'
environmentServiceNameAzureRM: 'azure-spn'
- task: TerraformTaskV2@2
displayName: 'apply'
inputs:
provider: 'azurerm'
command: 'apply'
environmentServiceNameAzureRM: 'azure-spn'