VCS root selection (among multiple vcs root configured for a build) based on the branch selected for build

Answered

I have many project(s) in my bitbucket and different VCS for each, the idea is I am trying to make a single build configuration in TC. So that Developers need not have to create multiple build configs in TC. They just need to add the VCS root & they are good to go..

Having said that I want a control on when I build the project based on the branch (feature, release etc) which is provided me in the drop down, ONLY the corresponding VCS which corresponds to the branch needs to be checked out & qualify for further build.

So far haven't found any such setting in relation, request you to please advice

3 comments
Comment actions Permalink

Hello Deversh,

Unfortunately, no, there is no such option as of now. Generally speaking, we would recommend to separate and reuse configurations where it is possible instead of combining as former allows for a more granular control over build process.

Could you please provide me with a few details on your build process? Is it the same set of operations on every repository which has to be built? Is there any notable difference in build logic for different repositories/branches/etc.? Perchance I will be able to suggest an alternative given more information.


1
Comment actions Permalink

Hello Fedor,

First of all thanks for your quick reply..

The outcome of our every build process is a jar file where in there are same set of operations/steps for every repo with no difference in build logic

Hence looking out for having same build config for every repo, idea is developers need not touch the CI/CD part, they just need to select their respective branch in dropdown & build

Regards,
Deversh

0
Comment actions Permalink

Hello Deversh,

My apologies for the delayed response here.
One approach I could think of is as following:
1) you could move the current build process into the build template (https://www.jetbrains.com/help/teamcity/build-configuration-template.html) with no VCS root attached;
2) whenever a new repository is to be added, developer could create a new configuration basing on the template (that would boil down to the VCS root addition and maybe trigger changes if needed)

This does not eliminate the whole configuration process for the developers, but that would significantly simplify the configuration creation for them.

Another possible approach is to disable the automated checkout (https://www.jetbrains.com/help/teamcity/vcs-checkout-mode.html) and use a custom command line script instead which would pull the changes from VCS root. You can still set up VCS roots in order to refer to their parameters in the script. This would allow you to describe your own logic of what to checkout basing on the input parameters. 

0

Please sign in to leave a comment.