我有一个步骤定义模板,打算在构建流水线中使用。
步骤定义的位置与构建流水线本身所在的文件夹不同。
在流水线验证期间,AzureDevops将构建流水线的位置视为根位置。这个位置被添加到引用路径中。
考虑以下代码层次结构示例。
以下适用于build.yaml如下所示:
如果您按照以下方式更改模板引用,将不起作用。
这里是文档,https://learn.microsoft.com/en-us/azure/devops/pipelines/process/templates?view=azure-devops#step-re-use 那么我该如何映射到存储在产品文件夹层次结构中的 step-def.yaml 文件?
在流水线验证期间,AzureDevops将构建流水线的位置视为根位置。这个位置被添加到引用路径中。
考虑以下代码层次结构示例。
azure
|----products
|----resource-type1
|----step-def.yaml
|----resource-type2
|----step-def.yaml
|----solutions
|----solution1
|----local-step-def.yaml
|----build.yaml
|----solution2
|----build.yaml
以下适用于build.yaml如下所示:
jobs:
- job: Linux
pool:
vmImage: 'ubuntu-16.04'
steps:
- template: solution1/local-step-def.yml
如果您按照以下方式更改模板引用,将不起作用。
- template: ../products/resource-type1/step-def.yml
在管道上进行验证时,Azure DevOps 会映射到
# <path-of-the-build-pipeline>/<template-ref>
azure/solutions/solution1/<template-reference>
这里是文档,https://learn.microsoft.com/en-us/azure/devops/pipelines/process/templates?view=azure-devops#step-re-use 那么我该如何映射到存储在产品文件夹层次结构中的 step-def.yaml 文件?