我有一个嵌套的 Azure DevOps YAML 管道:
---
name: Some Release Pipeline
trigger: none
variables:
- group: "DEV VARIABLE GROUP" # This is the environment variable library
stages:
- stage: Stage1
displayName: "Stage 1"
dependsOn: []
jobs:
- template: /pipelines/pipeline_templates/sometemplate.yml
Run Code Online (Sandbox Code Playgroud)
我想做的是在任何环境中重用这个发布管道。理想情况下,我会设置一个管道变量“group-name”,然后将其分配给该组。像这样的东西:
---
name: Some Release Pipeline
trigger: none
variables:
- group: "$(group-name)" # This is the environment variable library
stages:
- stage: Stage1
displayName: "Stage 1"
dependsOn: []
jobs:
- template: /pipelines/pipeline_templates/sometemplate.yml
Run Code Online (Sandbox Code Playgroud)
但是,这似乎不起作用。绝望地,我尝试了多种方法:
${{ group-name }} jobs:
- template: /pipelines/pipeline_templates/sometemplate.yml …Run Code Online (Sandbox Code Playgroud) azure azure-devops azure-pipelines azure-pipelines-release-pipeline