Branch filter issue

Answered
Hi Team, We have branches like master, release/abc,release/xyz and others, Our requirement is to have the option to run build only for master and release branches with this format release/..., However when we kept the branch filter as +:master-- it gives the option to run in master, however for release when I give the filter +:release/* It shows only branches with name release/release/abc to run the build, my question is how can we filter out branches for release/abc and others in this format, do we make some changes in branch specifications? Currently branch specifications filter all the branches
6 comments
Comment actions Permalink

Hello,

Could you please share the branch specification for this VCS root?

1
Comment actions Permalink

+:refs/heads/(master)
+:refs/heads/feature/*
+:refs/heads/release/*
+:*

1
Comment actions Permalink

Thank you! Branch filter works with logical branch name (which, in your case, would be the part of branch name covered by the asterisk). Suppose you have a branch called

release/v1.0

Then with above branch specification it will appear in TeamCity as

v1.0

You may ensure that the "release" is part of branch name by modifying the branch specification as following:

+:refs/heads/(master)
+:refs/heads/feature/*
+:refs/heads/(release/*)
+:*

Then the branch filter will properly handle such branches. Please let me know if this helps.

1
Comment actions Permalink

Hi, thank for your response, in the branch filter I could see the same results with new changes in branch specifications, to select the v1 branch as per your example except any other feature branch I will need to specify +:v1 only, I wanted to select all the branches which starts with release/v1 but could not find a way to specify that in branch filter after specifying
+:refs/heads/(master)
+:refs/heads/feature/*
+:refs/heads/(release/*)
+:*
in branch specifications
Please advise

0
Comment actions Permalink

Hello,

If you currently have 

+:refs/heads/(release/*)

in your branch specification, and you want to ensure only release/v1*** branches are triggered, then you could use the following branch filter:

+:release/v1*

Please let me know if this helps.

1
Comment actions Permalink

Great it worked thanks, I used +:release/* in branch filter and now I could see all the branches with name release/abc release/BCD e.t.c

0

Please sign in to leave a comment.