Multiple VCS Trigger with different "Per-checkin Triggering" for different branches
Hey All,
I need two VCS Triggers with different Per-Checkin Triggering rules based on a banch filter.
The reason: For the "release-*" & "master" branch when I merge everything in i don't want a build created per checkin, however i do when using any of the other branches. I though i could do this by adding a second trigger filtering the branches so they looked something like this:
The first VCS Trigger, this will build all of these branches with "Trigger a build on each check-in" checked
-:*
+:refs/heads/hotfix/hotfix-*
+:refs/heads/develop
+:refs/heads/feature/feature-*
The second VCS Trigger, this will build all of these branches with "Trigger a build on each check-in" unchecked
-:*
+:refs/heads/release/release-*
+:refs/heads/master
Is there another way I can do this?
Thanks
Steve
Please sign in to leave a comment.
The solution was to modify the build configuration XML. Steps were: Locate your TeamCity Project folder which is a subdir of the TeamCity Data Directory, mine was C:\ApplicationData\TeamCity\config\projects.
Find the build configuration in which every project subfolder it lives under example: C:\ApplicationData\TeamCity\config\projects\parentProj_Proj\buildTypes\build_config_name.xml
At the bottom of this file was where i found the build triggers section, find in there the current build trigger you have an duplicate it, but remember to change the "id" attribute on the "build-trigger" element. So my final config looks like this:
<build-triggers>
<build-trigger id="vcsTrigger" type="vcsTrigger">
<parameters>
<param name="branchFilter"><![CDATA[-:*
+:refs/heads/hotfix/hotfix-*
+:refs/heads/develop
+:refs/heads/feature/feature-*]]></param>
<param name="groupCheckinsByCommitter" value="true" />
<param name="perCheckinTriggering" value="true" />
<param name="quietPeriodMode" value="DO_NOT_USE" />
</parameters>
</build-trigger>
<build-trigger id="vcsTrigger1" type="vcsTrigger">
<parameters>
<param name="branchFilter"><![CDATA[-:*
+:refs/heads/release/release-*
+:refs/heads/master]]></param>
<param name="quietPeriodMode" value="DO_NOT_USE" />
</parameters>
</build-trigger>
</build-triggers>
This although probably unsupported seems to work just fine.
TeamCity guys, can you confirm this will be OK?
Hello, Steven
Thanks for creating a feature request for this functionality in our issue tracker.
There is no possibility to make 2 VCS triggers working.
A workaround idea here can be to create two build configurations based on the same template and setup different VCS triggers for them.
I do have this successfully working use the above method. Hopefully you will add UI support later
Hello Steven,
Please clarify which version of TeamCity do you use.
This version: 10.0.3 (build 42434)