我有一个从另一个存储库扩展模板的管道。该外部模板需要一个stageList
called stages
.
我的管道:
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:
我的步骤包括一些本地化,我需要执行task
对于每种语言。我目前将每种语言手动定义为单独的任务:
- task: MSBuild@1
displayName: 'Build (de-DE)'
inputs:
solution: '$(Build.SourcesDirectory)\MyProject.wixproj'
msbuildArguments: '/p:Cultures="de-DE"
...more args, 15 lines long...
...对每种语言重复。总的。
所以我想尝试使用模板来实现这一点。但是当我将 MSBuild 任务移动到另一个文件并尝试时
- template: ./templates/localizedBuild.yml
parameters:
language: 'de-DE'
然后当我去排队管道运行时,ADO 给出了这个错误:
“stages”参数不是有效的 StageList。
/.pipelines/MyPipeline.yml:在存储库中找不到文件 /templates/localizedMsi.ymlhttps://company.visualstudio.com/OtherProject/_git/OtherRepo https://company.visualstudio.com/OtherProject/_git/OtherRepo
据我了解,这是因为模板的路径是相对于执行包含操作的文件来计算的...这是BaseTemplate.yml
文件,不是MyPipeline.yml
.
有没有办法在 yml 中表明我正在尝试引用模板my repo?