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 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.

2
3 comments

Hi Pradeep,

Normally teamcity only triggers builds on commits, not on tag/branch creation. We have the issue here to add official support for it, please vote and watch: https://youtrack.jetbrains.com/issue/TW-43606

If you check the issue, you can find a property that would allow teamcity to run builds on new branches/tags, namely: teamcity.vcsTrigger.runBuildInNewEmptyBranch=true

0
Avatar
Permanently deleted user

Hi,

I'm trying to set this up and it's not triggering for some reason.

VCS

Default Branch: master

Branch Specification: 

+:refs/tags/(*)

+:refs/heads/(*)

Enabled to use tags in the branch specifiction: checked

 

Triggers:

Branch Filter: +:*

 

Parameters:

Configuration Parameters: 

Name: teamcity.vcsTrigger.runBuildInNewEmptyBranch   Value: true

 

In source control, the same revision as master is tagged.

 

If a code change is made and committed to master, the build triggers as expected.

What am I doing wrong to cause the new tags not to trigger a build?

I'm running 2017.1.3 (build 46961)

Thanks

0

Could you please provide teamcity-vcs-states.logs and teamcity-vcs.logs from TeamCity server and the id of build configuration and VCS root where trigger doesn't work?

0

Please sign in to leave a comment.