2021-02-24 23:44:58 -06:00
|
|
|
parameters:
|
|
|
|
- name: 'preSteps'
|
|
|
|
type: stepList
|
|
|
|
default: []
|
2021-04-07 18:05:31 -05:00
|
|
|
- name: 'buildSteps'
|
|
|
|
type: stepList
|
|
|
|
default: []
|
2021-02-24 23:44:58 -06:00
|
|
|
- name: "postSteps"
|
|
|
|
type: stepList
|
|
|
|
default: []
|
|
|
|
- name: 'jobGroups'
|
|
|
|
type: object
|
|
|
|
default: []
|
|
|
|
- name: 'jobVariables'
|
|
|
|
type: object
|
|
|
|
default: {}
|
|
|
|
- name: 'scriptEnv'
|
|
|
|
type: object
|
|
|
|
default: ''
|
|
|
|
- name: 'timeoutInMinutes'
|
|
|
|
type: 'number'
|
2021-11-09 09:35:18 -06:00
|
|
|
default: 900
|
2021-02-24 23:44:58 -06:00
|
|
|
- name: 'jobFilters'
|
|
|
|
type: object
|
|
|
|
default: ''
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
- ${{ each jobGroup in parameters.jobGroups }}:
|
2021-04-07 18:05:31 -05:00
|
|
|
- ${{ if or(eq(parameters.jobFilters, ''), containsValue(parameters.jobFilters, jobGroup.name), endswith(variables['Build.DefinitionName'], format('.{0}{1}', jobGroup.name, jobGroup.extName))) }}:
|
2021-02-24 23:44:58 -06:00
|
|
|
- job: ${{ replace(format('{0}{1}', jobGroup.name, jobGroup.extName), '-', '_') }}
|
|
|
|
${{ each pair in jobGroup }}:
|
|
|
|
${{ if not(in(pair.key, 'job', 'name', 'extName', 'variables', 'steps', 'script', 'scriptEnv')) }}:
|
|
|
|
${{ pair.key }}: ${{ pair.value }}
|
|
|
|
${{ if eq(jobGroup.timeoutInMinutes, '') }}:
|
|
|
|
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
|
|
|
|
variables:
|
|
|
|
GROUP_NAME: ${{ jobGroup.name }}
|
|
|
|
GROUP_EXTNAME: '${{ jobGroup.extName }}'
|
|
|
|
GROUP_NAMES: ${{ join(',', parameters.jobGroups.*.name ) }}
|
|
|
|
${{ if ne(jobGroup.variables, '') }}:
|
|
|
|
${{ jobGroup.variables }}
|
|
|
|
${{ each para in parameters.jobvariables }}:
|
|
|
|
${{ if eq(jobGroup.variables[para.key], '') }}:
|
|
|
|
${{ para.key }}: ${{ para.value }}
|
|
|
|
steps:
|
|
|
|
- ${{ parameters.preSteps }}
|
|
|
|
- ${{ if ne(jobGroup.script, '') }}:
|
|
|
|
- script: |
|
|
|
|
${{ jobGroup.script }}
|
|
|
|
env:
|
|
|
|
${{ if ne(parameters.scriptEnv, '') }}:
|
|
|
|
${{ parameters.scriptEnv }}
|
|
|
|
displayName: 'JobScript'
|
|
|
|
- ${{ if ne(jobGroup.steps, '') }}:
|
|
|
|
- ${{ jobGroup.steps }}
|
2021-04-07 18:05:31 -05:00
|
|
|
- ${{ parameters.buildSteps }}
|
2021-02-24 23:44:58 -06:00
|
|
|
- ${{ parameters.postSteps }}
|