-
Notifications
You must be signed in to change notification settings - Fork 54
/
bicep_build_stage.yml
55 lines (53 loc) · 1.89 KB
/
bicep_build_stage.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
parameters:
- name: environmentObjects
type: object
default:
- environmentName: 'dev'
regionAbrvs: ['cus']
- name: templateFileName
type: string
default: 'main'
- name: templateDirectory
type: string
default: 'infrastructure'
- name: serviceName
type: string
- name: deploymentScope
type: string
default: 'subscription'
- name: bicepParamExt
type: boolean
default: false
stages:
- stage: '${{ parameters.serviceName }}_build'
variables:
- name: bicepParamString
${{ if eq(parameters.bicepParamExt, true)}} :
value: '.bicepparam'
${{ else }} :
value: '.json'
jobs:
- template: ../jobs/ado_publish_job.yml
parameters:
targetPath: ${{ parameters.templateDirectory }}
artifactname: ${{ parameters.templateDirectory }}
- ${{ each environmentObject in parameters.environmentObjects }} :
- ${{ each regionAbrv in environmentObject.regionAbrvs }} :
- ${{ if eq(parameters.deploymentScope, 'subscription')}} :
- template: ../jobs/bicep_whatif_env_job.yml
parameters:
environmentName: ${{ environmentObject.environmentName }}
templateFileName: ${{ parameters.templateFileName }}
templateDirectory: ${{ parameters.templateDirectory }}
serviceName: ${{ parameters.serviceName }}
regionAbrv: ${{ regionAbrv }}
paramExt: ${{ variables.bicepParamString }}
- ${{ elseif eq(parameters.deploymentScope, 'resourceGroup')}} :
- template: ../jobs/bicep_whatif_rg_env_job.yml
parameters:
environmentName: ${{ environmentObject.environmentName }}
templateFileName: ${{ parameters.templateFileName }}
templateDirectory: ${{ parameters.templateDirectory }}
serviceName: ${{ parameters.serviceName }}
regionAbrv: ${{ regionAbrv }}
paramExt: ${{ parameters.bicepParamString }}