@@ -42,6 +42,12 @@ parameters:
42
42
- name : PreGenerationSteps
43
43
type : stepList
44
44
default : []
45
+ - name : EnablePRGeneration
46
+ type : boolean
47
+ default : false
48
+ - name : PRMatrixSetting
49
+ type : string
50
+ default : ' ArtifactPackageNames'
45
51
# Mappings to OS name required at template compile time by 1es pipeline templates
46
52
- name : Pools
47
53
type : object
@@ -84,57 +90,87 @@ jobs:
84
90
85
91
- ${{ parameters.PreGenerationSteps }}
86
92
87
- - ${{ each config in parameters.MatrixConfigs }} :
93
+ - ${{ if eq(parameters.EnablePRGeneration, false) }} :
94
+ - ${{ each config in parameters.MatrixConfigs }} :
95
+ - ${{ each pool in parameters.Pools }} :
96
+ - ${{ if eq(config.GenerateVMJobs, 'true') }} :
97
+ - task : Powershell@2
98
+ inputs :
99
+ pwsh : true
100
+ filePath : eng/common/scripts/job-matrix/Create-JobMatrix.ps1
101
+ arguments : >
102
+ -ConfigPath ${{ config.Path }}
103
+ -Selection ${{ config.Selection }}
104
+ -DisplayNameFilter '$(displayNameFilter)'
105
+ -Filters '${{ join(''',''', parameters.MatrixFilters) }}', 'container=^$', 'SupportedClouds=^$|${{ parameters.CloudConfig.Cloud }}', 'Pool=${{ pool.filter }}'
106
+ -Replace '${{ join(''',''', parameters.MatrixReplace) }}'
107
+ -NonSparseParameters '${{ join(''',''', config.NonSparseParameters) }}'
108
+ displayName : Create ${{ pool.name }} Matrix ${{ config.Name }}
109
+ name : vm_job_matrix_${{ config.Name }}_${{ pool.name }}
110
+ - ${{ if eq(config.GenerateContainerJobs, 'true') }} :
111
+ - task : Powershell@2
112
+ inputs :
113
+ pwsh : true
114
+ filePath : eng/common/scripts/job-matrix/Create-JobMatrix.ps1
115
+ arguments : >
116
+ -ConfigPath ${{ config.Path }}
117
+ -Selection ${{ config.Selection }}
118
+ -DisplayNameFilter '$(displayNameFilter)'
119
+ -Filters '${{ join(''',''', parameters.MatrixFilters) }}', 'container=^$', 'SupportedClouds=^$|${{ parameters.CloudConfig.Cloud }}', 'Pool=${{ pool.filter }}'
120
+ -NonSparseParameters '${{ join(''',''', config.NonSparseParameters) }}'
121
+ displayName : Create ${{ pool.name }} Container Matrix ${{ config.Name }}
122
+ name : container_job_matrix_${{ config.Name }}_${{ pool.name }}
123
+
124
+ # This else being set also currently assumes that the $(Build.ArtifactStagingDirectory)/PackageInfo folder is populated by PreGenerationSteps.
125
+ # Not currently not hardcoded, so not doing the needful and populating this folder before we hit this step will result in generation errors.
126
+ - ${{ else }} :
88
127
- ${{ each pool in parameters.Pools }} :
89
- - ${{ if eq(config.GenerateVMJobs, 'true') }} :
90
- - task : Powershell@2
91
- inputs :
92
- pwsh : true
93
- filePath : eng/common/scripts/job-matrix/Create-JobMatrix.ps1
94
- arguments : >
95
- -ConfigPath ${{ config.Path }}
96
- -Selection ${{ config.Selection }}
97
- -DisplayNameFilter '$(displayNameFilter)'
98
- -Filters '${{ join(''',''', parameters.MatrixFilters) }}', 'container=^$', 'SupportedClouds=^$|${{ parameters.CloudConfig.Cloud }}', 'Pool=${{ pool.filter }}'
99
- -Replace '${{ join(''',''', parameters.MatrixReplace) }}'
100
- -NonSparseParameters '${{ join(''',''', config.NonSparseParameters) }}'
101
- displayName : Create ${{ pool.name }} Matrix ${{ config.Name }}
102
- name : vm_job_matrix_${{ config.Name }}_${{ pool.name }}
128
+ - pwsh : |
129
+ # dump the conglomerated CI matrix
130
+ '${{ convertToJson(parameters.MatrixConfigs) }}' | Set-Content matrix.json
103
131
104
- - ${{ if eq(config.GenerateContainerJobs, 'true') }} :
105
- - task : Powershell@2
106
- inputs :
107
- pwsh : true
108
- filePath : eng/common/scripts/job-matrix/Create-JobMatrix.ps1
109
- arguments : >
110
- -ConfigPath ${{ config.Path }}
111
- -Selection ${{ config.Selection }}
112
- -DisplayNameFilter '$(displayNameFilter)'
113
- -Filters '${{ join(''',''', parameters.MatrixFilters) }}', 'container=^$', 'SupportedClouds=^$|${{ parameters.CloudConfig.Cloud }}', 'Pool=${{ pool.filter }}'
114
- -NonSparseParameters '${{ join(''',''', config.NonSparseParameters) }}'
115
- displayName : Create ${{ pool.name }} Container Matrix ${{ config.Name }}
116
- name : container_job_matrix_${{ config.Name }}_${{ pool.name }}
132
+ ./eng/common/scripts/job-matrix/Create-PrJobMatrix.ps1 `
133
+ -PackagePropertiesFolder $(Build.ArtifactStagingDirectory)/PackageInfo `
134
+ -PRMatrixFile matrix.json `
135
+ -PRMatrixSetting ${{ parameters.PRMatrixSetting }} `
136
+ -DisplayNameFilter '$(displayNameFilter)' `
137
+ -Filters '${{ join(''',''', parameters.MatrixFilters) }}', 'container=^$', 'SupportedClouds=^$|${{ parameters.CloudConfig.Cloud }}', 'Pool=${{ pool.filter }}' `
138
+ -Replace '${{ join(''',''', parameters.MatrixReplace) }}'
139
+ displayName: Create ${{ pool.name }} PR Matrix
140
+ name: vm_job_matrix_pr_${{ pool.name }}
117
141
118
- - ${{ each config in parameters.MatrixConfigs }} :
119
- - ${{ each pool in parameters.Pools }} :
120
- - ${{ if eq(config.GenerateVMJobs, 'true') }} :
121
- - template : ${{ parameters.JobTemplatePath }}
122
- parameters :
123
- UsePlatformContainer : false
124
- OSName : ${{ pool.os }}
125
- Matrix : dependencies.${{ parameters.GenerateJobName }}.outputs['vm_job_matrix_${{ config.Name }}_${{ pool.name }}.matrix']
126
- DependsOn : ${{ parameters.GenerateJobName }}
127
- CloudConfig : ${{ parameters.CloudConfig }}
128
- ${{ each param in parameters.AdditionalParameters }} :
129
- ${{ param.key }} : ${{ param.value }}
142
+ - ${{ if eq(parameters.EnablePRGeneration, false) }} :
143
+ - ${{ each config in parameters.MatrixConfigs }} :
144
+ - ${{ each pool in parameters.Pools }} :
145
+ - ${{ if eq(config.GenerateVMJobs, 'true') }} :
146
+ - template : ${{ parameters.JobTemplatePath }}
147
+ parameters :
148
+ UsePlatformContainer : false
149
+ OSName : ${{ pool.os }}
150
+ Matrix : dependencies.${{ parameters.GenerateJobName }}.outputs['vm_job_matrix_${{ config.Name }}_${{ pool.name }}.matrix']
151
+ DependsOn : ${{ parameters.GenerateJobName }}
152
+ CloudConfig : ${{ parameters.CloudConfig }}
153
+ ${{ each param in parameters.AdditionalParameters }} :
154
+ ${{ param.key }} : ${{ param.value }}
130
155
131
- - ${{ if eq(config.GenerateContainerJobs, 'true') }} :
132
- - template : ${{ parameters.JobTemplatePath }}
133
- parameters :
134
- UsePlatformContainer : true
135
- OSName : ${{ pool.os }}
136
- Matrix : dependencies.${{ parameters.GenerateJobName }}.outputs['vm_job_matrix_${{ config.Name }}_${{ pool.name }}.matrix']
137
- DependsOn : ${{ parameters.GenerateJobName }}
138
- CloudConfig : ${{ parameters.CloudConfig }}
139
- ${{ each param in parameters.AdditionalParameters }} :
140
- ${{ param.key }} : ${{ param.value }}
156
+ - ${{ if eq(config.GenerateContainerJobs, 'true') }} :
157
+ - template : ${{ parameters.JobTemplatePath }}
158
+ parameters :
159
+ UsePlatformContainer : true
160
+ OSName : ${{ pool.os }}
161
+ Matrix : dependencies.${{ parameters.GenerateJobName }}.outputs['vm_job_matrix_${{ config.Name }}_${{ pool.name }}.matrix']
162
+ DependsOn : ${{ parameters.GenerateJobName }}
163
+ CloudConfig : ${{ parameters.CloudConfig }}
164
+ ${{ each param in parameters.AdditionalParameters }} :
165
+ ${{ param.key }} : ${{ param.value }}
166
+ - ${{ else }} :
167
+ - ${{ each pool in parameters.Pools }} :
168
+ - template : ${{ parameters.JobTemplatePath }}
169
+ parameters :
170
+ UsePlatformContainer : false
171
+ OSName : ${{ pool.os }}
172
+ Matrix : dependencies.${{ parameters.GenerateJobName }}.outputs['vm_job_matrix_pr_${{ pool.name }}.matrix']
173
+ DependsOn : ${{ parameters.GenerateJobName }}
174
+ CloudConfig : ${{ parameters.CloudConfig }}
175
+ ${{ each param in parameters.AdditionalParameters }} :
176
+ ${{ param.key }} : ${{ param.value }}
0 commit comments