Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trigger a build on applying a tag

I want to achieve the following:

  1. Anyone in the dev team creates a tag i.e. Demo_Build_1 to dev branch.
  2. TeamCity should be able to detect this new tag and build only this tag.

I have enabled "treat tag as a branch" checkbox in VCS configuration.

I have tried configuring it but I am not able to get it working. Following is my VCS setting: enter image description here
and following is how I have configured my build trigger: enter image description here

I don't want to trigger a build manually. My idea is that TeamCity should be able to pick up this new tag and run the build. Any pointers to achieve this objective would be helpful.

like image 700
Pradeep Avatar asked May 18 '17 11:05

Pradeep


People also ask

How do tags work in Git?

Tagging is generally used to capture a point in history that is used for a marked version release (i.e. v1. 0.1). A tag is like a branch that doesn't change. Unlike branches, tags, after being created, have no further history of commits.


1 Answers

You've got it nearly right. You can use configuration parameter teamcity.vcsTrigger.runBuildInNewEmptyBranch=true to tell TeamCity to build on tag creation -- https://youtrack.jetbrains.com/issue/TW-43606. Otherwise TeamCity won't trigger a build when you see a new tag.

like image 116
Marc Durdin Avatar answered Sep 27 '22 20:09

Marc Durdin