How to get TeamCity Build trigger filter to build feature branches but not default branch
Asked Answered
H

2

8

I've created a Team City build to build the feature branches:

Default Branch: refs/heads/development Branch Specification: refs/heads/feature/*

I have a vcs trigger so it builds for every git push. But I don't want it to build when someone pushes to the development branch.

I have tried playing with the branch filter in the trigger, but either features and development build on push, or none of them do.

I'm using TC 9.1.1

Hornblende answered 17/9, 2015 at 13:47 Comment(0)
A
13

Try the following settings:
Default Branch: refs/heads/development
Branch Specification: +:refs/heads/feature/*

VCS trigger branch filter:

+:*  
-:<default>
Affranchise answered 17/9, 2015 at 13:52 Comment(3)
Yes, that did it. I'd tried the -:&lt;default&gt; on it's own, but not the +:*. Thank youHornblende
Is <default> meant to be written verbatim, or should i put in for instance -:/refs/heads/development?Fix
Would be helpful to support explicit path/branch triggers than having to rely on explicit exceptions.Jamikajamil
E
0

We are using TC 2017.2 and had the same problem. We could disable the automatic triggering, but you could still start it by hand, which is annoying as it will keep a build agent occupied for nothing.

Then we found out we have the option to disable the actual build of a feature branch. If you go to Version Control Settings there is a Default Branch Settings section.

More info here

Elgon answered 19/11, 2018 at 7:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.