Branch specification and tagging

We use Git with TeamCity 8.0, and we use branching. Branches are:

master
develop
feature-foo
feature-bar
feature-baz (etc.)

We also want to use tags, e.g.,

build-1.0.0
build-1.0.1

I've tried so many times to set the branch specification to make this work, but I keep getting the wrong behavior. Previously, I had:

+:refs/heads/*

With my default branch set to "master". This mostly worked, except:

1. I commit to master
2. TC builds master
3. TC tags the build
4. TC builds my tag!

So every push to master would result in two builds - one for master, and one for the tag.

So I tried to be more specific:

+:refs/heads/develop
+:refs/heads/(feature-*)

But TC is still building my tags, and I can see two branches "master" and "refs/heads/master" which shows as my default.

How do I tell TC to build my braches without building my tags?

3 comments
Comment actions Permalink

If you can distinguish commits that are moving tags somehow you can exclude them using trigger rules in VCS trigger:
http://confluence.jetbrains.com/display/TCD8/Configuring+VCS+Triggers#ConfiguringVCSTriggers-VCSTriggerRules

0
Comment actions Permalink

Hi Paul,

First of all, thanks for Octopus.

I'm not sure I quite understand fully. Is it that you want to be able to build from master, branches and tags, however you don't want to trigger a build on a tag if one is in the queue for master? Or do you not want to build from tags at all?

Is "Use tags as branches" ticked in your VCS configuration?

have you tried -:refs/tags/* in your branch specification or VCS trigger?

0
Comment actions Permalink

Thanks for the response. I've tried what you suggested; this is what my branch spec looks like in the VCS settings:

+:refs/heads/*

-:refs/tags/*

And this is what my branch filter looks like in the VCS trigger:

+:refs/heads/develop

+:refs/heads/master

+:refs/heads/feature-*

-:refs/tags/*

However it was still building all tags. Then I disabled the GitHub TeamCity webhook and the problem went away. The webhook doesn't appear to support wildcards so I didn't enter anything in the branch field, so it was notifying for tags too.

0

Please sign in to leave a comment.