I have a pipeline that extends a template from another repository. That external template takes a stageList called stages.
My pipeline:
resources:
repositories:
- repository: templates
type: git
name: OtherProject/OtherRepo
ref: refs/heads/main
extends:
template: BaseTemplate.yml@templates
stages:
- stage: build
jobs:
- job: main
steps:
My steps include some localization, where I need to execute a task for each language. I currently have each language manually defined as a separate task:
- task: MSBuild@1
displayName: 'Build (de-DE)'
inputs:
solution: '$(Build.SourcesDirectory)\MyProject.wixproj'
msbuildArguments: '/p:Cultures="de-DE"
...more args, 15 lines long...
...repeated for each language. Gross.
So I'd like to try to use templates for this. But when I move the MSBuild task to another file and try
- template: ./templates/localizedBuild.yml
parameters:
language: 'de-DE'
then ADO gives me this error when I go to queue up a pipeline run:
The 'stages' parameter is not a valid StageList. /.pipelines/MyPipeline.yml: File /templates/localizedMsi.yml not found in repository https://company.visualstudio.com/OtherProject/_git/OtherRepo
As I understand it, this is because paths to templates are calculated relative to the file doing the including... which is the BaseTemplate.yml file, not MyPipeline.yml.
Is there a way to indicate in the yml that I'm trying to reference a template in my repo?