我讨厌 Azure DevOps,但我一直在使用它......他们有一个
Docker@2
任务,其中有这个 文档
字符串。选修的。当 command = build || 时使用命令=推||命令 = buildAndPush.默认值:$(Build.BuildId)。指定单独行上的标签列表。这些标签用于 build、push 和 buildAndPush 命令。
具体 -> 在单独的行上指定标签列表。
有人能够让这个工作吗?
我尝试过:
steps:
- task: Docker@2
displayName: build and push image
inputs:
containerRegistry: <my-registry-connection>
repository: <my-repo-name>
command: 'buildAndPush'
tags:
- latest
- $(Build.SourceVersion)
失败了
/build-pipeline.yml(第 20 行,第 7 列):不是预期的序列
和
steps:
- task: Docker@2
displayName: build and push image
inputs:
containerRegistry: <my-registry-connection>
repository: <my-repo-name>
command: 'buildAndPush'
tags:
latest
$(Build.SourceVersion)
失败了:
“-t,--tag”标志的参数“***/my-repo-name:my-commit最新”无效:参考格式无效
我想
separate lines
对不同的人来说意味着不同的事情:
这有效:
steps:
- task: Docker@2
displayName: build and push image
inputs:
containerRegistry: <my-registry>
repository: <my-repository>
command: 'buildAndPush'
tags: latest,$(Build.SourceVersion)
这也可以(注意“|”):
steps:
- task: Docker@2
displayName: build and push image
inputs:
containerRegistry: <my-registry>
repository: <my-repository>
command: 'buildAndPush'
tags: |
latest
$(Build.SourceVersion)