【发布时间】:2021-09-04 14:52:24
【问题描述】:
我正在尝试在我的 YAML 模板上创建一个变量(组),前提是某个参数具有值。我正在使用以下 sn-p:
variables:
- name: variableGroupName
value: app-${{parameters.environmentInitials}}
- template: /pipelines/variables/${{parameters.environmentInitials}}.yml
- group: ${{variables.variableGroupName}}
${{if parameters.parentEnvironmentInitials}}:
- group: app-${{parameters.parentEnvironmentInitials}}
然而,当我尝试触发管道时,我得到了错误:
Encountered error(s) while parsing pipeline YAML: Expected a mapping - Unexpected state while attempting to read the mapping end. State:
SequenceState:
IsStart: False
Index: 3
IsEnd: True
MappingState:
IsStart: False
Index: 3
IsKey: False
IsEnd: False
SequenceState:
IsStart: False
Index: 0
IsEnd: False
MappingState:
IsStart: False
Index: 0
IsKey: False
IsEnd: False
我已经尝试了几种组合,因为我找不到一个示例声明有条件的组而没有任何成功,知道吗?
谢谢
【问题讨论】:
标签: yaml azure-pipelines