Versioned Settings and Feature Branches

Hi,

I wanted to find out more information about versioned settings in TeamCity. I have been reading the documentation page: https://confluence.jetbrains.com/display/TCD10/Storing+Project+Settings+in+Version+Control

There isn't a lot of information on the "use project settings from VCS" option, so I was hoping someone could provide me a more detailed explanation. We are trying to apply different build settings to different branches for some of our projects. I found a post, https://blog.jetbrains.com/teamcity/2018/01/branch-specific-settings-in-teamcity/, explaining how to do just that, but it didn't explain how to store the settings in an external repository in detail.

I also did some investigation on my own by setting up a project in TeamCity. I figured out that the versioned settings are pull from the branch that matches the branch the build is occurring on. If the branch doesn't exist then it just grabs the settings from the default branch (master in my case). However, these kind of details aren't discussed in the "use project settings from VCS" section of the documentation. I specifically wanted to know how the process works when we have multiple VCS roots and when we have wild-cards in the roots. For example, I have been trying out settings on pull-request branches. I found that the pull-request name needs to match exactly for the settings to be used, but I want to figure out a way to grab settings that apply to all pull-request builds.

More generally, we are trying to have a single VCS root for a configuration that acts slightly differently depending on which branch is being built. We may want to skip some steps for pull-requests but not develop. We also may want artifacts for develop and release branches but not pull-request branches. We could use templates and make these minor adjustments there, but it increases the number of build configurations considerably. Also each configuration would basically do the same thing, so having multiple configurations makes the project look cluttered.

Have any customers come across this problem and found a solution?

Thanks!

0
1 comment
Official comment

Hello Max,

Thank you for the feedback. We will try to improve the related documentation page based on your feedback.

Answering your questions, the only possible way to use branch-specific versioned settings is to store those settings in the branch itself. It would not be possible to build all pull requests using same set of settings, different from those used to build default branch.

It is recommended to have different build configurations (or projects, if you need to maintain a set of build configurations) for the set of branches which are built together. It is not a good idea to try to implement different procedure for building different branches in the scope of the single build configuration.

To reuse the settings you can use build configuration templates or consider switching to Kotlin Settings DSL and generate the projects from the code.

Please sign in to leave a comment.