【发布时间】:2019-10-06 20:06:30
【问题描述】:
是否可以根据某种模板表达式选择性地包含模板?具体来说,我希望我在 azure-pipelines.yml 中的顶级定义调用在包含的阶段模板中使用哪些构建作业模板:
天蓝色管道.yml:
stages:
- template: generic-build-stage.yml # Template reference
parameters:
# Example of optional build templates to use
buildTypes: [SpecificBuildJobs1, SpecificBuildJobs3, SpecificBuildJobs4]
通用构建阶段.yml:
parameters:
buildTypes: ???
stages:
- stage: generic_build
jobs:
${{ }} # ???? What goes here to include the appropriate templates
- template: ???
上面的模板表达式理想情况下会扩展为:
jobs:
- template: specific-build-jobs1.yml
- template: specific-build-jobs3.yml
- template: specific-build-jobs4.yml
编辑:docs 中的“迭代插入”示例似乎表明某种形式的动态、解析时插入是可能的。
【问题讨论】:
标签: azure-devops