使用扩展时为什么看不到参数?

问题描述 投票:0回答:0
我们有两个非常相似的DevOps(在本地托管的服务器上)项目,它们在要处理的文件列表上有所不同,但是这些过程几乎相同。

为了避免代码重复,我们使用共享组件,例如variables-common.yml,dobuild.yml,以及特定于产品的组件,例如build-foo.yml和build-bar.yml.yml.y。 comply to the the Intial Foo-pipeline.yml都非常有效,该最初是用共同的base-pipeline.yml延伸的。添加bar-pipeline.yml会产生一个我无法理解的问题。

管道foo和bar是相同的,除了“ foo”和“ bar”,所以我只显示foo:

# FOO-pipleline.yml parameters: - name: cleanAgents displayName: Wipe agents before build type: boolean default: false values: - false - true - name: buildSoftware displayName: Build software type: boolean default: true values: - false - true - name: runAnalysis displayName: Run static code analysis type: boolean default: true values: - false - true variables: - template: Variables/variables-FOO.yml - template: Variables/variables-Common.yml name: FOO-$(productVersion)-$(Date:yyMMdd)$(Rev:rr) resources: repositories: - repository: FOO type: git name: FOO ref: main trigger: branches: include: - main paths: # Paths where a code change triggers a run include: - Libraries - repository: FOO-TestComplete type: git name: FOO-TestComplete ref: main trigger: none trigger: - none # CI: main extends: template: Base-pipeline.yml parameters: productName: FOO cleanAgents: ${{ parameters.cleanAgents }} buildSoftware: ${{ parameters.buildSoftware }} runAnalysis: ${{ parameters.runAnalysis }}

there是base-pipeline.yml的简短版本:

# Base-pipleline.yml parameters: - name: productName type: string - name: cleanAgents type: boolean default: false - name: buildSoftware type: boolean stages: - stage: stage_Build_without_analysis # ============================ displayName: 'Build ${{ parameters.productName }}, no analysis' pool: demands: BuildServer condition: or(${{ eq(parameters.buildSoftware, true) }},${{ eq(parameters.runUnitTests, true) }}, ${{ eq(parameters.runAnalysis, true) }}) jobs: - template: /Build/Build.yml

杠上线的问题(与foo相同,与bar相同)是我遇到了一个错误
必须提供“清洁剂”参数的值。

在那里,它适用于foo,可用于foo。酒吧不是这样。

奇怪的观察可能有助于找到问题:
如果我在扩展模板中使用 /base-pipeline.yml(添加slash),则验证器告诉我它不存在,并列出了所有现有的yaml文件。此列表包含base-pipeline.yml

twice

。我不明白为什么,但这可能是相关的。

必须提供“清洁剂”参数的值。

this误差意味着参数

cleanAgents

没有在管道中使用的模板(或子审核)之一中设置。

azure-devops azure-pipelines azure-pipelines-yaml
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.