本文介绍了VSTS:无法添加触发发布的Build Tag的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在VSTS在线中,我在发布"过程中(触发器"下)检查了连续部署".在Set trigger on artifact source上,我将标记条件(with tags)设置为自动.

In VSTS online, I have in my Release process (Under Triggers) the Continuous Deployment checked. On the Set trigger on artifact source, I put a Tag condition (with tags) set to Automated.

在构建过程中我也有一个标签. (将标记正确添加到内部版本中)

I also have a tag in the Build Process. (Correctly adds the Tag to the build)

但是我的发布不会自动触发吗?在部署"状态(在我的构建中)中,它显示为发布触发器设置的标记与构建分支中的标记不匹配".但是它们匹配(参见图片).可能是什么问题?

But my release is not triggered automatically? In the Deployments status (In my Build) it says "Tags set for release trigger did not match the tags in build branch". But they match (See pictures). What could be the issue?

推荐答案

这是因为在构建完成后(通过标签来源或手动)添加了标签Automated.这无法触发CD发行. 应该在构建期间添加标签(尚未完成构建).因此,您可以在构建定义中添加带有嵌入式脚本的 power shell 任务:

This is because you added the tag Automated after the build is finished (by label source or manually). This can’t trigger CD release. Tags should be add during a build (not a build is finished). So you can add a power shell task with inline script in your build definition:

Write-Host "##vso[build.addbuildtag]Automatd"

然后将在构建完成后触发发行版.

Then the release will be trigger after build is finished.

这篇关于VSTS:无法添加触发发布的Build Tag的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 04:12