Syncing TeamCity Project Settings, across VCS branches: possible?
We have a project with several TeamCity build configurations, which we would like to copy, and over time, sync to and from other branches on our VCS server.
Our project is storing TeamCity settings on our VCS server, using files encoded in TeamCity's Kotlin-based DSL.
Each branch appears to store TeamCity build configuration data in separate sub-directories, off of the main ".teamcity" directory (that TeamCity created).
Can TeamCity Project Configuration files be setup in such a way, that we could synchronize most settings, if not all settings, such as build configurations, build steps, etc., across VCS branches by copying files within the VCS server? It looks like these files have a lot of UUIDs in them, so I am hesitant to try without first asking if this might be possible.
Please sign in to leave a comment.
Hi David,
I'm not sure I understand what you mean with copy to, and from, other branches. There are 2 places to have branches on:
-Your project runs builds from multiple branches. You can have them build with the same settings, or different settings. In the second case, you probably want to have separate build configurations for each different set of settings.
-You want to have multiple branches on the VCS that stores the project settings.
If you are trying to generate programatically different configurations for different projects/branches, that's perfectly doable, more information on our series of blog posts: https://blog.jetbrains.com/teamcity/2017/01/kotlin-configuration-scripts-creating-configuration-scripts-dynamically/
If you are simply trying to generate new projects by copying some of them in the VCS, yes, that also works. Simply create any unique UUID of your own, until you commit it it won't get synced, so it's fine.
If I missed what you are trying to get, please feel free to correct me in my understanding, I'll try to help out.
Hello Denis!
My use-case can be boiled down to the following:
We have an app with two branches, in VCS: Dev and Staging. Nightly builds are made from both of those branches. These builds are made via TeamCity. Each branch has multiple build configurations, within TeamCity.
Periodically, we merge Dev's content, into Staging (then continue working asynchronously, in both branches). This merge is usually just a copy of Dev, into Staging (with Staging being merged into Dev, before-hand).
We recently-started storing Mainline's TeamCity settings in our VCS server, within the Mainline branch itself. We'd like to store QA's TeamCity settings in VCS as well, within the QA branch.
When we merge branches, we'd like any changed TeamCity settings to be merged over, as well, with a minimal amount of work on the part of the merger. For example: say we add a new TeamCity build step in Dev. When we merge Dev into Staging, we'd like that build step to appear in QA.
Any suggestions on doing the above? Is such possible?