Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSTS - Continuous Delivery - Release Trigger not working with tags

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.

enter image description here

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

enter image description here

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

enter image description here

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

enter image description here

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

like image 447
jacqijvv Avatar asked Feb 28 '17 06:02

jacqijvv


People also ask

How do you trigger a release pipeline automatically?

Select trigger: Set the trigger that will start the deployment to this stage automatically. Select "Release" to deploy to the stage every time a new release is created. Use the "Stage" option to deploy after deployments to selected stages are successful. To allow only manual deployments, select "Manual".


1 Answers

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

enter image description here

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")
like image 185
starian chen-MSFT Avatar answered Dec 31 '22 18:12

starian chen-MSFT