Given a .yml like this:
stages:
- stage: build
jobs:
- template: /eng/common/templates/jobs/jobs.yml
parameters:
jobs:
- job: Build_Linux
timeoutInMinutes: 120
disableComponentGovernance: true # <--- this causes an error
steps:
....
results in an Azure Pipelines error:
/eng/common/templates/jobs/jobs.yml (Line: 45, Col: 3): 'disableComponentGovernance' is already defined
If I read it correctly this happens because this code passes along parameters from jobs.yml into the job.yml so we end up with one disableComponentGovernance from jobs.yml and one from the job:
|
jobs: |
|
- ${{ each job in parameters.jobs }}: |
|
- template: ../job/job.yml |
|
parameters: |
|
# pass along parameters |
|
${{ each parameter in parameters }}: |
|
${{ if ne(parameter.key, 'jobs') }}: |
|
${{ parameter.key }}: ${{ parameter.value }} |
The same happens with the other parameters that are forwarded, like continueOnError etc.
/cc @mmitche