-
Notifications
You must be signed in to change notification settings - Fork 6
/
azure-pipeline.yml
103 lines (89 loc) · 3.19 KB
/
azure-pipeline.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
99
100
101
102
103
### Trigger Pipeline for all Merges into master.
trigger:
batch: true
branches:
include:
- master
paths:
include:
- azure-pipeline.yml
- /pipelines/*
- /modules/*
exclude:
- /**/*.md
### Trigger Pipeline for all Pull Requests into master.
pr:
autoCancel: true
branches:
include:
- '*'
paths:
include:
- azure-pipeline.yml
- /pipelines/*
- /modules/*
- /samples/*
exclude:
- /**/*.md
variables:
### Version of Terraform to be used in the pipeline.
- name: 'TF_VERSION'
value: '0.12.21'
### Version of Go to be used in the pipeline.
- name: 'GO_VERSION'
value: '1.12.14'
### Root Directory of modules and templates are found.
- name: 'TF_ROOT_DIR'
value: 'samples'
### Root Directory of where the ADO Pipelines are found for nested templates.
- name: 'PIPELINE_ROOT_DIR'
value: 'pipelines'
### Required Variables in the Group
### BUILD_ARTIFACT_NAME
### FORCE_RUN
### SERVICE_CONNECTION_NAME
- group: 'iac-terraform-variables'
### ** These are loaded in stage-build.yml and stage-deploy.yml **
## -------------------------------------------------------------------------------
### Required Env Group Variables - `{env_name} Environment Variables`
### ARM_SUBSCRIPTION_ID
### TF_VAR_remote_state_account
### TF_VAR_remote_state_container
### TF_VAR_location
stages:
- template: pipelines/compose-stages.yml
parameters:
## -------------------------------------------------------------------------------
### Environments are the list of each environment that the pipeline should create
### enablePrIsolation - Create a temporary new environment with the PR number. Pair this with Configuration - TeardownAfterRelease
### resourceNameIsolationLevel -- Specify how many unique characters are used in the naming convention.
environments:
- name: 'dev'
resourceNameIsolationLevel: 8
enablePrIsolation: false
skipTests: false
### Only deploy this environment when using master branches.
# - ${{ if eq(variables['Build.SourceBranchName'], 'master') }}:
# - name: 'prod'
# enablePrIsolation: false
# resourceNameIsolationLevel: 8
## -------------------------------------------------------------------------------
### Configurations are the list templates that the pipeline should create.
### terraformWorkspacePrefix is the prefix used for all resources
### terraformTemplatePath is the path of the template to be executed.
### deploymentTimeoutInMinutes is length of time before timing out with an error.
### environmentsToTeardownAfterRelease is the list of environments to execute tf destroy on.
configurations:
- jobName: simpleweb
terraformWorkspacePrefix: 'sw'
terraformTemplatePath: 'samples/simpleweb'
terraformModulePath: 'modules'
deploymentTimeoutInMinutes: 20
environmentsToTeardownAfterRelease:
- 'dev'
# Only deploy this configuration when not using master branch.
# - ${{ if ne(variables['Build.SourceBranchName'], 'master') }}:
# - jobName: webdata
# terraformWorkspacePrefix: wd
# terraformTemplatePath: 'samples/webdata'
# deploymentTimeoutInMinutes: 120