Question:
How can I automatically trigger a build when a new tag gets created in the repository?
Answer:
There are some basic steps the need to be done:
- Use the setting to track tags in the VCS Root:
Enable to use tags in the branch specification - Make sure the branch specification includes the tags.
- If you are filtering branches on your VCS trigger, make sure to add the tags as branches to the filter.
- If the triggers don't happen, check whether the branches are actually being detected. Access your build configuration overview and check if the tags are added to the list of branches.
- If branches are detected, you might need to add the property
teamcity.vcsTrigger.runBuildInNewEmptyBranchto the build configuration or project. It's likely that TeamCity is considering the tag as a "new empty branch". Just keep in mind that if you create new empty branches on the repository, those will also trigger builds. - If branches are not detected, and the VCS Root has already checked for changes, there is an issue with the branch specification that is preventing the tags from being detected.
- If branches are detected, you might need to add the property
Comments
0 comments
Please sign in to leave a comment.