VSTS: Unable to add Build Tag that launches release

In VSTS online, I am testing continuous deployment during the release process (in the Triggers section). In Set trigger on artifact source

I put the tag condition ( with tags

) set to Automated .

Release trigger

I also have a tag in my build process. (Adds tag to assembly correctly)

But my release won't start automatically? The Deployment status (In my build) says, "The tags set for the release trigger do not match the tags in the build branch." But they match (see photos). What could be the problem?

Build

+5


source to share


3 answers


This is because you added the tag Automated

after the build finished (using a tag source or manually). This is a compact CD release. Tags must be added at build time (build not complete) . This way you can add a power shell task with an inline script to your build definition:

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

      



The release will then run after the build is complete.

enter image description here

+8


source


For future readers, it looks like you can now trigger the release even when the tag is added to the build at any time (not just during build).

Create release when tags are added to an existing build



Create a release when tags are added to an existing assembly. After enabling this option, a release is created when tags are added to an existing build that has not been released. This can lead to the deployment of the old assembly in the environment.

+3


source


I do it in a different way, very similar to: How to initiate VSTS build and release when tags are clicked?

In my release pipeline, I add a branch filter to 'refs / tags /' or 'refs / tags / v' for a continuous deployment trigger, or wherever I want to filter the action in my release pipeline. The good thing is that you can apply your Git tag AFTER your build is complete, as you are. This is optional, but I am using Git in conjunction with GitVersion.

Also, be aware that Git tags and build tags are not the same. Git tags are stored in a Git repository, while build tags are associated with a VSTS / Azure build generalization. Don't be confused with them.

0


source







All Articles