问题
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!
回答1:
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:
来源:https://stackoverflow.com/questions/49531359/prevent-release-trigger-on-gated-check-in-build