-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipeline.yaml
116 lines (102 loc) · 3.34 KB
/
azure-pipeline.yaml
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# Docs:
# https://aka.ms/yaml
trigger:
batch: true
branches:
include:
- master
resources:
repositories:
- repository: cnp-azuredevops-libraries
type: github
ref: refs/heads/master
name: hmcts/cnp-azuredevops-libraries
endpoint: 'hmcts'
variables:
- name: timeoutInMinutes
value: 60
- name: agentPool
value: ubuntu-20.04
- name: build
value: $(Build.BuildNumber)
- name: product
value: cft-platform
- name: terraformInitSubscription
value: 04d27a32-7a07-48b3-95b8-3c8691e1a263
- template: vars/input-variables.yaml@cnp-azuredevops-libraries
parameters:
- name: overrideAction
type: string
default: plan
values:
- plan
- apply
- destroy
- name: environment_components
type: object
default:
- deployment: 'sbox_finops_reporting'
environment: 'sbox'
component: 'finops'
service_connection: 'dcd-cftapps-sbox'
storage_account_rg: 'core-infra-sbox-rg'
storage_account_name: 'cftappssbox'
dependsOn: 'Precheck'
- deployment: 'ptl_finops_reporting'
environment: 'ptl'
component: 'finops'
service_connection: 'DTS-CFTPTL-INTSVC'
storage_account_rg: 'core-infra-intsvc-rg'
storage_account_name: 'cftptlintsvc'
dependsOn: 'sbox_finops_reporting'
- deployment: 'sbox_law_finops_dashboard'
environment: 'sbox'
component: 'law-finops-dashboard'
service_connection: 'DCD-CFT-Sandbox'
dependsOn: 'Precheck'
- deployment: 'qa_law_finops_dashboard'
environment: 'test'
component: 'law-finops-dashboard'
service_connection: 'DCD-CNP-QA'
dependsOn: 'sbox_law_finops_dashboard'
- deployment: 'nonprod_law_finops_dashboard'
environment: 'dev'
component: 'law-finops-dashboard'
service_connection: 'DCD-CNP-DEV'
dependsOn: 'qa_law_finops_dashboard'
- deployment: 'prod_law_finops_dashboard'
environment: 'prod'
component: 'law-finops-dashboard'
service_connection: 'DCD-CNP-Prod'
dependsOn: 'nonprod_law_finops_dashboard'
stages:
- stage: Precheck
jobs:
- job:
pool:
vmImage: ${{ variables.agentPool }}
timeoutInMinutes: ${{ variables.timeoutInMinutes }}
steps:
- template: steps/terraform-precheck.yaml@cnp-azuredevops-libraries
parameters:
keyvaultName: 'infra-vault-nonprod'
keyvaultSecret: 'azure-devops-sp-token'
serviceConnection: 'azurerm-sandbox'
overrideAction: ${{ parameters.overrideAction }}
- ${{ each deployment in parameters.environment_components }}:
- stage: ${{ deployment.deployment }}
dependsOn: ${{ deployment.dependsOn }}
jobs:
- job: TerraformPlanApply
pool:
vmImage: ${{ variables.agentPool }}
timeoutInMinutes: ${{ variables.timeoutInMinutes }}
steps:
- template: steps/terraform.yaml@cnp-azuredevops-libraries
parameters:
overrideAction: ${{ parameters.overrideAction }}
environment: ${{ deployment.environment }}
component: ${{ deployment.component }}
serviceConnection: ${{ deployment.service_connection }}
terraformInitSubscription: ${{ variables.terraformInitSubscription }}
product: ${{ variables.product }}