-
Notifications
You must be signed in to change notification settings - Fork 9
/
vdc-terraform-apply-cd.yml
98 lines (93 loc) · 2.51 KB
/
vdc-terraform-apply-cd.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# This pipeline performs a full CI test of the VDC:
# - Provision infrastructure
# - Deploy application
# - Test application
# - Destroy infrastructure
parameters:
- name: buildWorkspace
displayName: Build Pipeline Environment / Terraform Workspace
type: string
default: ci1
values:
- ci1
- ci2
- ci3
- name: releaseWorkspace
displayName: Release Pipeline Environment / Terraform Workspace
type: string
default: cd1
values:
- cd1
- cd2
- cd3
- name: buildDestroy
displayName: Destroy build infrastructure
type: string
default: Always
values:
- Always
- 'On failure'
- 'On success'
- name: deploy
displayName: Deploy applications
type: boolean
default: true
- name: deployIaaS
displayName: Deploy IaaS application
type: boolean
default: true
- name: releaseDestroy
displayName: Destroy release infrastructure
type: string
default: Never
values:
- Never
- 'On failure'
- 'On success'
- name: testMode
displayName: Test Mode (disable most tasks)
type: boolean
default: false
trigger: none
pr: none
variables:
- template: ./templates/vdc-terraform-apply.variables.yml
# This pipeline assumes TF_VAR_* variables are defined in Variable Groups defined in Library
# The Terraform VDC project requires quite a number of settings
- group: 'vdc-cd'
- name: 'TF_VAR_build_id'
value: '$(Build.BuildId)'
- name: 'TF_VAR_release_id'
value: '$(Build.BuildId)'
- name: 'TF_VAR_release_user_email'
value: '$(Build.RequestedForEmail)'
- name: 'TF_VAR_release_web_url'
value: '$(System.TeamFoundationCollectionUri)/$(System.TeamProject)/_build/results?buildId=$(Build.BuildId)&view=results'
stages:
- template: ./templates/vdc-terraform-apply.yml
parameters:
name: 'CI'
displayName: 'Provision, Deploy, Tear down'
inherit: false
provision: true
reprovision: true
deploy: ${{ parameters.deploy }}
deployIaaS: ${{ parameters.deployIaaS }}
destroy: ${{ parameters.buildDestroy }}
resourceSuffix: 'b$(Build.BuildId)'
testMode: ${{ parameters.testMode }}
workspace: ${{ parameters.buildWorkspace }}
- template: ./templates/vdc-terraform-apply.yml
parameters:
name: 'Release'
displayName: 'Release'
inherit: true
provision: true
reprovision: false
deploy: ${{ parameters.deploy }}
deployIaaS: ${{ parameters.deployIaaS }}
deploymentName: 'demo'
destroy: ${{ parameters.releaseDestroy }}
testMode: ${{ parameters.testMode }}
vdcArtifactPipeline: current
workspace: ${{ parameters.releaseWorkspace }}