VSTS - Continuous Delivery - Release Trigger not working with tags

删除回忆录丶 提交于 2019-12-22 05:40:47

问题


UPDATE 2017/02/28

The tags in the release triggers are not source control tags, they are tags that can be generated by your build step. You can tag your builds automatically (see below), or manually during a build, I haven't tried this yet.

My assumption about the tags were flawed, which makes this question pretty much invalid. However I am going to try and see if I can find some sort of workaround for my exact scenario, and then I will post it here.

Background

I am setting up our CI/CD pipeline using VSTS, and part of our branching strategy is that only release/* branches that are tagged will be deployed to production.

Problem

I am trying to trigger a release using the VSTS Continuous Deployment feature, which should be able to work with branches and tags. At first I tried this, thinking that I could use a wildcard for everything:

Attempt 1

The trigger never worked, so I decided that it is probably not supported (because I can't find any documentation around it). So I tried an explicit tag.

Attempt 2

That didn't work either, so I decided to abandon the release/* wildcard altogether and just attempt it with a specific release branch.

Attempt 3

Still didn't work. I am either missing some really important steps here, or it is broken. Please help.

PS - For every attempt, I made sure that I committed a new file in git, tagged the commit, and kicked off a new CI build.

PS - Specifying a wildcard for branches like release/* works perfectly, as long as you leave the tag field empty


回答1:


It is filtered by the build tag instead of source tag/label.

For example, a release definition CD with myTag filter, then the corresponding new build need to have myTag.

To add the tag to build, you can refer to these steps:

  1. Edit your build definition
  2. Add PowerShell step (Inline Script: Write-Host "##vso[build.addbuildtag]myTag")


来源:https://stackoverflow.com/questions/42501293/vsts-continuous-delivery-release-trigger-not-working-with-tags

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!