3
votes

Over the years I've used three different strategies to build from seperate TFS branches in TeamCity builds:

  • used different VCS roots for the two branches, each pointing to the full TFS path of the branch
  • used a shared VCS root, and parameterized some of the path
  • used a shared VCS root pointing at the root of the source tree, and used different checkout rules per project (eg +:MyBranch => . )

My question is: what is the 'best' one, and what are the pros and cons of the three approaches?

1
How did this go for you? I'm starting to research my options, and there's not much out there to go off.Matt

1 Answers

4
votes

Each of the pattern have its on pros and cons:

  1. The first approach of having different VCS roots for the two branches, each pointing to the full TFS path of the branch is making the things simple and easy to understand. But, each time you create a build configuration you need to add a new VCS root and delete the same once you clear the build configuration because there is no option to do that VCS root deletion automatically when you delete a build configuration.

  2. The second approach of having a shared VCS root, and parameterized some of the path is making the things bit complex and if there are multiple people in your team taking care of build configuration maintainance, then all of them should know which are these parameters you are setting and probably you may need to document the same. For a newbee in the team it will be a total unkwnown which are these parameters. I perosnally will not go by this.

  3. The third approach of having a shared VCS root pointing at the root of the source tree, and used different checkout rules per project is looking a bit tidy approach. This is having two advantages. One is that you don't need to keep track of a mass of VCS roots and the second thing is that the checkout rule easy being edited at the same tab as version control settings and it makes things simple even for a newbee.

On the basis of complexity my preference order is: 1 - 3 - 2

On the basis of maintainability my preference order is: 3 - 1 - 2