-
Notifications
You must be signed in to change notification settings - Fork 213
/
Copy pathazure-pipelines.yml
62 lines (57 loc) · 2.75 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
trigger:
- master
variables:
backendServiceArm: 'AZURE_5_SUBSCRIPTION'
backendAzureRmResourceGroupName: 'resourcegroup-devops-tfstate'
backendAzureRmStorageAccountName: 'terraform0tfstate0'
backendAzureRmContainerName: 'tfstate'
location: 'westeurope'
tfBackendEnvironment: tf_backend
devEnvironment: dev
testEnvironment: test
prodEnvironment: prod
tfWorkingDirectory: 'terraform'
stages:
- template: template-create-terraform-backend.yml
parameters:
environment: ${{ variables.tfBackendEnvironment }}
environmentDisplayName: Create TF Backend
backendServiceArm: ${{ variables.backendServiceArm }}
backendAzureRmResourceGroupName: ${{ variables.backendAzureRmResourceGroupName }}
backendAzureRmStorageAccountName: ${{ variables.backendAzureRmStorageAccountName }}
backendAzureRmContainerName: ${{ variables.backendAzureRmContainerName }}
location: ${{ variables.location }}
dependsOn: []
- template: template-terraform-stages.yml
parameters:
environment: ${{ variables.devEnvironment }}
environmentDisplayName: Dev
backendServiceArm: ${{ variables.backendServiceArm }}
backendAzureRmResourceGroupName: ${{ variables.backendAzureRmResourceGroupName }}
backendAzureRmStorageAccountName: ${{ variables.backendAzureRmStorageAccountName }}
backendAzureRmContainerName: ${{ variables.backendAzureRmContainerName }}
backendAzureRmKey: $(devEnvironment).tfstate
workingDirectory: $(tfWorkingDirectory)
dependsOn: ['${{ variables.tfBackendEnvironment }}']
- template: template-terraform-stages.yml
parameters:
environment: ${{ variables.testEnvironment }}
environmentDisplayName: Test
backendServiceArm: ${{ variables.backendServiceArm }}
backendAzureRmResourceGroupName: ${{ variables.backendAzureRmResourceGroupName }}
backendAzureRmStorageAccountName: ${{ variables.backendAzureRmStorageAccountName }}
backendAzureRmContainerName: ${{ variables.backendAzureRmContainerName }}
backendAzureRmKey: $(testEnvironment).tfstate
workingDirectory: $(tfWorkingDirectory)
dependsOn: ['${{ variables.tfBackendEnvironment }}']
- template: template-terraform-stages.yml
parameters:
environment: ${{ variables.prodEnvironment }}
environmentDisplayName: Production
backendServiceArm: ${{ variables.backendServiceArm }}
backendAzureRmResourceGroupName: ${{ variables.backendAzureRmResourceGroupName }}
backendAzureRmStorageAccountName: ${{ variables.backendAzureRmStorageAccountName }}
backendAzureRmContainerName: ${{ variables.backendAzureRmContainerName }}
backendAzureRmKey: $(prodEnvironment).tfstate
workingDirectory: $(tfWorkingDirectory)
dependsOn: ['${{ variables.tfBackendEnvironment }}', '${{ variables.devEnvironment }}', '${{ variables.testEnvironment }}']