Can anyone tell me what the best way would be to configure TeamCity builds when I want to run identical build configurations, but on different VCS roots?
e.g; I have several 'build & test' configurations for a repository (for each project in the repo), and I want to duplicate all the settings across our master/develop/r1.0/etc branches?
In the past I've just duplicated the entire build config set and changed the VCS root to achieve this, but as the number of branches grows (with more release branches added over time), how can I simplify my configurations and minimise how many places I would need to make changes if something about the build changed?
A VCS root in TeamCity defines a connection to a version control system. It represents a set of parameters (paths to sources, username, password, and other settings) that determine how TeamCity communicates with a VCS to monitor changes and get sources for a build.
Here's my point of view to this problem. I think that solution for you is using Build configuration template + parametrization in VCS root. We have about 20 build configurations (1 configuration = 1 branch), made only by two templates and one vcs root. All common stuff for configuration is kept in template. Only few specific params are in configuration itself and you seth them on creation of configuration from template. One of them is branch name which is highly related to configuration name in my case.
Templates are
VCSroot points only to root of source control. Branch parameter of vcs root is set to custom branch parameter that build configuration inherits from build configuration template.
We have branches structured like this
-Master
-Development
-Releases__3.4.1
|_3.4.2
|_3.4.3
Master and development are using Continuous integration template, and each new release branch is using Release configuration template. For me the proces of creating new configuration for 3.4.4 branch is like this:
Point is that Branch name parameter in Release template is like this
%BranchPath%=Release/%ConfigurationName%
For Continuous integration template it would be
%BranchPath%=%ConfigurationName%
Further in VCS root branch is set to %BranchPath% passed in to it from configuration, so VCS can work with both templates, and all 20 configurations And thats all.. :) Hope it somehow helps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With