Teamcity: versioned settings, build templates and different VCS roots - teamcity

I'm trying to ensure that my entire build configuration in Teamcity is under configuration management.
But, I'm also sharing a build template across different projects (with different VCS roots). The template is used in different sub-projects in Teamcity, where the VCS root is specified.
So, when I enable Versioned Settings for the project, only the specific settings are added, not the contents of the template. And as the template are defined in the root project, I can't enable Versioned Settings at this level.
Any suggestions?
BR
Rasmus

Create or move VCS-roots in Root Project or parent project,
if you change anything in above vcs-roots you can apply it to one or all configuration, there is an option in the last section of vcs-root setting looks like

Related

Intellij Idea - Define custom and different Gradle User Home by Project

I am working with ideaIC-2020.2.3
I am able two open two windows to open two different projects for each window respectively. These projects are based on Gradle, for example
Spring Framework
Spring Integration
About settings I am able to define the gradle user home location, but it is common for all the projects. I want to know (if is possible - by the IDE itself or through a special plugin) define for each Project a custom and isolated (or different) gradle user home location. I tried for each project do right clic and Open Module Settings and does not exist something to accomplish this goal.
Observation: in STS/Eclipse - for Maven is possible for example that for each workspace import a custom and different settings.xml file indicating a specific and different repository.
It is not possible. Please vote for IDEA-163506.

Best directory for Gradle build resources (e.g. license header template)

I'm looking for the appropriate location to place resources that are used by the build, like a license header template file or a file with code formatter settings.
The buildSrc seems like the most appropiate place (e.g. buildSrc/src/main/resources), but I only found it mentioned in the context of Build sources.
Another option would be src/build/resources. Perhaps there are better locations I didn't consider.
What would be the most appropriate directory for these resources?
In many gradle builds the convention of using $rootproject/gradle as folder for build resources has been established. you can have a config folder to store your license files / checkstyle configs etc. in there.

Share configs of a project between several projects in TeamCity

I have a project called SPI with 15 configs. Those configs have dependency on a build config of project A.
I have been asked to run those same 15 SPI configs for project B and C. A, B and C are not dependent on each other. One way to do it is replicate the SPi project for B and C. But maintenance will be a nightmare. DO you have any suggestions on how to address this situation? DO you think I should use meta-runner? It will reduce the maintenance but not remove it. Any input is highly appreciated.
Which version of Teamcity are you using? Teamcity 8 has Build Configuration templates. I'm not sure when they were first introduced but if you have access to them, I'd recommend using them.
You can create build configuration templates from existing ones. So in your case, you can ask to create a build configuration template from each of the configs you have in project A. You can then modify those templates to make them generic and keep the customization specific to project A in project A itself. Then, base projects B and C's build configurations on the templates and simply customize the parts you need to in both those projects.
Here's more information: http://confluence.jetbrains.com/display/TCD8/Build+Configuration+Template
Build configuration templates is how we have set up our build system to build multiple branches of the same source code. When something must change, the changes are made to the templates which means they are automatically inherited by all projects that leverage said templates.

Configure TeamCity to build from branches

I have C# project in TFS + TeamCity (TC). Now i have tag 1.0, trunk 2.0 and TC build config for 2.0.
I need to enable build for 1.0 from tag (and for future tag 2.0, 3.0, etc..).
I've created common TC project MyProject with all necessary configurations. Now i added subproject '1.0 release brunch'. And i'm goning to copy all configurations from root project + change VCS roots of that configuration. When i'll have to make tag 2.0 i'll create subproject '2.0 release brunch' and copy all root configurations to this subproject and change VCS root.
Is this normal steps to support previous projects? Should i use configuration templates or something? Each project contains 5+ configurations to build CI and Full Release builds with all changes, E2E testing, etc. So this is not just copy configuration to the subproject and change VCS root. This seems will be a tuning for every project. And i'd like to automate this as much as possible.
One way of handling this situation is to create a single build configuration and use a parameter in the VCS trunk. So instead of using a VCS root of
https://server/svn/MyProject/trunk/
you would instead use
https://server/svn/MyProject/%TagPath%/
Then create a configuration parameter in the TeamCity build configuration called TagPath and simply set it's value to trunk or tags/1.0 or whatever.
The one caveat to be aware of no matter how you do this is that you will have problems if your build process changes in the future and in that case you would probably end up creating separate "old" and "new" build configurations.
You can use Build configuration template for this. You can create the template at the root project level and then use it for sub projects.
Look at the "Redefining settings inherited from template" section in the link below on how to use parameters to change the values at the sub-project level.
http://confluence.jetbrains.com/display/TCD8/Build+Configuration+Template

Build Project > How to checkout different repositories in different folders

I am new to TeamCity. I have my projects in different repositories. I want to checkout my projects in Different subfolders. e.g.
Lets suppose that I have following 3 .net Projects in three different projects.
Framework
XYZ
MyProject
Each project is stored in its own repository. MyProject contains a solution file, which expects that Framwork and XYZ Projects Folders are in main Folder so that the Folder structure looks like that
+FrameWork
-ProjectFile
-.........
+XYZ
-ProjectFile
+MyProject
-SolutionFile(has references of both Projects.)
Now my problem is I want to checkout my projects from different repositories in own Folders. How to configure it in TeamCity.
Thanks
You would need to configure each VCS Root in Version Control Settings. For each root, you can
specify what folders are of interest to you with the Checkout Rules. When creating the checkout rules, you have the option to leave the folder structure the same as it is in your VCS or you can remap the struture to suit your needs.
http://confluence.jetbrains.net/display/TCD5/2.Version+Control+Settings
http://confluence.jetbrains.net/display/TCD5/VCS+Checkout+Rules
In Order to solve the given problem. Following checkout Rules need to be applied on corresponding version control root.
+:.=>FrameWork
+:.=>XYZ
+:.=>MyProject

Resources