we are using the extend feature to reuse templates in our pipelines in a secure way. For easier defining the parameters for the template I would like to use variables but I feel this is not possible.
But since I could not find an answer in the official docs I am asking in this round.
My yml file looks like this:
name: '[$(Date:yyyyMMdd).$(Rev:r)][$(Build.SourceBranchName)]'
# ========================================================================
# Pipeline Triggers
# ========================================================================
schedules:
- cron: "0 22 * * *" # time in UTC timezone
displayName: Daily midnight build for mainline branches
branches:
include:
- develop
- master
always: true
- cron: "0 22 * * *" # time in UTC timezone
displayName: Daily midnight build for release branches
branches:
include:
- release/*
always: false
# ========================================================================
# Template resource
# ========================================================================
resources:
repositories:
- repository: templates # id for reuse in below script code
type: git
name: Tools/pipeline-templates
ref: develop
variables:
Test: TestGroup
# ========================================================================
# Template reference
# ========================================================================
extends:
template: template.yml@templates # Template reference
parameters:
Param1:
- "-T test"
When I try to run it I get following error:
__built-in-schema.yml (Line: xx, Col: yy): 'variables' is already defined
I feel since our template is also using variables it cannot be used in the root yml file.
Thank you