Mar292013

Simultaneously Build Multiple VCS Branches In TeamCity

Another quick TeamCity tip: how to configure your VCS build settings to trigger on multiple branches.

We use a branching system in Mercurial based on something similar to this:

  • Default Branch
    • Sprint-YYYMMDD Branch
      • Story Branch
      • Story Branch
      • Story Branch

So, at a normal given time, we'll have two stable branches: Default, and Sprint-*. We can configure TeamCity to build the default branch, as well as any Sprint-* branch:

01_vcssetup

Then, anytime we check-in to one of those branches, it triggers a build and labels the branches appropriately:

02_branchesonbuild

It even adds an "Active Branches" drop down for filtering:

03_activebranches

This has proven to be very useful in making sure our default and sprint branches stay stable, as we can build, run unit tests, and other tasks to check the integrity of our code.