防止在门控签入构建上发布触发器 [英] Prevent Release Trigger on Gated Check-in build

查看:22
本文介绍了防止在门控签入构建上发布触发器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在不产生任何工件的 Gated 签入构建上停止释放触发器?

我有一个启用了门控签入的构建定义.在发布和发布工件步骤中,我将条件设置如下:

<块引用>

ne(variables['Build.Reason'],'CheckInShelveset')

这意味着 - 如果构建是由 Gated 签入触发的,则不要运行此步骤.

我在此构建运行的放置文件夹中没有看到任何文件,但是一旦门控构建完成运行,就会触发发布.

我添加了图片以供参考.

  • 图 1 显示了构建定义的配置.
  • 图 2 显示发布"步骤没有运行,因为它是一个门控构建.
  • 图 3 显示了即使 drop(输出)文件夹中没有任何内容,也会从同一构建触发的发布!

这让我很惊讶.有什么帮助吗?

谢谢!

解决方案

第一个环境有一个选项可以设置 Artifact 过滤器,输入 Include TriggerRelease:

通过标记您的构建(以防它不是门控签入),您可以防止触发发布.你可以运行一个小的magic log命令来设置构建中的标签:

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

或者您可以

How to stop the release trigger on Gated check-in build which doesn;t produce any artifact?

I have a build definition with Gated check-in enabled. In Publish and Publish Artifact Steps I have set the condition as following:

ne(variables['Build.Reason'],'CheckInShelveset')

which means - if the build was triggered by Gated check-in, do not run this step.

I do not see any files in drop folder of this build run but the release is being triggered as soon the gated build completes running.

I've added images for reference purposes.

  • Image 1 shows the configuration of build definition.
  • Image 2 shows the "publish" steps are not running as it's a gated build.
  • Image 3 shows the release being triggered from the same build even when there is nothing in drop (output) folder!

This is very surprising to me. Any help?

Thanks!

解决方案

There is an option on the first environment where you can set an Artifact filter, enter Include TriggerRelease:

By tagging your build (in case it's not a gated check-in), you can prevent the release from triggering. You can run a small magic log command to set the tag in the build:

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

Or you can use a build task from the following extension to have a build tag itself:

这篇关于防止在门控签入构建上发布触发器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆