TeamCity 7.1 Branch Builds Rock

I’ve been using TeamCity as my CI server of choice for years now because the folks at JetBrains just keep making it better.  Branch builds are just another example of the kind of thoughtful goodness I have come to expect from these guys.

It’s all designed to fix a problem that occurs when a team takes advantage of the power of a DVCS system like Git or Mercurial.  When a developer starts working on a feature, he or she makes a local feature branch that gets pushed to the main repository periodically.  Once the feature is done, the branch is merged into the main development branch.  Traditionally, the CI server is configured to build the main development branch.  That means developers lose the benefit of all the checks the CI server does whenever they are working on a feature branch.

It gets even worse when you have multiple team members collaborating on feature branches or working on closely related feature branches.   For example, Mark checks in Feature X that Mary would like to merge with her work.  The problem is she has no way to know the code in Feature X passes tests or even compiles before she pulls it down to her local machine.  If it is broken, she ends up wasting valuable time on something she probably should not have tried to merge in the first place.

TeamCity solves this by allowing you to setup your configuration to automatically build all or selected active branches without treating them like they are supposed to be stable.  Although TeamCity shows their status, broken feature branches do not impact the overall project status; As long as the main branch builds and passes all tests, the project status will still be good.

Setup could not be easier especially if you just want to build all feature branches.  You simply go to the VCS root and configure which branches you want to build as shown here:

The specification “+:*” tells TeamCity to build all branches automatically.

Once you do this, you’ll start seeing branch names next to the builds on the main screen.  You can also see a screen with a summary of the state of each branch like this:

Very useful indeed.

TeamCity Professional is free if you have fewer than 20 build configurations.  It includes three free build agents.  If you need more than 20 build configurations or you need Active Directory integrated security, the Enterprise edition is $1,999.  Additional build agents cost $299 each.  You can see the complete price list and license details on the TeamCity web site.

Author: Tom Cabanski

Software Developer and Entrepreneur

%d bloggers like this: