Best Practice for Identity TeamCity Based on Different VCS Roots

Can someone tell me that the best way is to configure TeamCity assemblies when I want to run identical assembly configurations, but on different VCS roots?

eg; I have several build and test configurations for the repository (for each project in the repo), and I want to duplicate all the settings in our branches master / develop / r1.0 / etc?

In the past, I just duplicated the entire set of build configurations and changed the VCS root to achieve this, but as the number of branches grows (with the addition of more release branches over time), how can I simplify my configurations and minimize how many places I have will need to make changes if something changes in the assembly?

+5
source share
1 answer

Here is my point of view on this issue. I think the solution for you is to use the assembly configuration template + parameterization in the root of VCS. We have about 20 build configurations (1 configuration = 1 branch) made by only two templates and one vcs root. All common configuration materials are stored in a template. Only a few specific parameters are in the configuration itself, and you type them when creating the configuration from the template. One of them is the name of the branch, which in my case is of great importance with the configuration name.

Patterns

  • Continuous integration pattern - where you want to test projects, builds
  • Release Template - Build Build to Build Plus

VCSroot points only to the source control root. The vcs root branch parameter is set to a user branch parameter, which inherits the configuration configuration from the assembly configuration template.

We have branches structured this way

-Master -Development -Releases__3.4.1 |_3.4.2 |_3.4.3 

The wizard and development uses a continuous integration pattern, and each new release branch uses the Release configuration pattern. For me, the process of creating a new configuration for branch 3.4.4 is as follows:

  • Create a new configuration
  • Select Template Select: Release
  • Enter configuration name Enter: 3.4.4
  • Save
  • Run assembly

A dot is a branch name parameter in the Release template, like this

 %BranchPath%=Release/%ConfigurationName% 

For a continuous integration template, this will be

 %BranchPath%=%ConfigurationName% 

The VCS root branch is set to% BranchPath%, passed to it from the configuration, so VCS can work with both templates and all 20 configurations. And that’s all .. :) I hope this helps somehow

+4
source

Source: https://habr.com/ru/post/1212055/


All Articles