具有Azure YML管道中的DICE类型变量

问题描述 投票:0回答:1
variables: - template: ../../ci-cd/ado_variables/vars.yml - template: ../../ci-cd/ado_variables/${{ parameters.vnet }}_vars.yml - name: files value: aaa: aaa.zip bbb: bbbb.zip

不幸的是,当我使用这种格式时,Azure Devops会抱怨:

/ci-cd/ado_pipelines/run_ingestion.yml(线:76,col:5):映射
不是预期的

有一种方法可以实现我想要的东西?并稍后在管道中访问此变量? 非常感谢

这是一项复杂的任务,即建议没有管道来源的东西。但是,您可以考虑使用此示例中的参数(或用作数组):

https://learn.microsoft.com/en-us/azure/devops/pipelines/process/process/process/process/processions?view = azure-devops#every-keykeyword

azure-devops azure-pipelines pipeline
1个回答
0
投票
parameters: - name: listOfFiles type: object default: - key: 'apple' name: 'apple.txt' - lemon: 'lemon' name: 'lemon.txt' steps: - ${{ each file in parameters.listOfFiles }} : - script: echo ${{ file.key }} ${{ file.name }}

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.