Shared git VCS root with %branch% Parameter?

It appears that I cannot do that - which is sad.

I would like to set up a project with build tasks for a set of git repos of one branch, then copy the project to clone the setup for a different branch, all the while retaining the capability to change the VCS root url for all projects in one place.

No can do?

(I don't get any error when I do that, it just ignores my branch setting and checks out master)

7 comments
Comment actions Permalink

Another way to ask the question: when is %branch% in a VCS root evaluated?

0
Comment actions Permalink

Christian,

The setup you described should work. I'd check the values of the parameter for the build configuration, project and template, if involved.
You can check the actual value of the parameter in the build's Parameters tab and look up the default value shown for the parameter.

> when is %branch% in a VCS root evaluated?
The value of the paramter is used for periodic checking for changes and for build checkout. If the parameter is specific in Run custom build dialog, it is not used as it is "too late" for VCS operations.

0
Comment actions Permalink

So, when I copy a project with the intention of changing the %branch% project parameter, should I be copying the VCS roots or sharing them?

0
Comment actions Permalink

Actually, both should work and should produce the same results, as aplying actual parameters' values should produce equal results in either case.

There will be subtle difference as TeamCity stores some data per-VCS root and in case of two VCS roots it can duplicate. However, I cannot name any significant user-visible difference.
I'd go with a shared VCS root...

0
Comment actions Permalink

Ok, I see what happened:

When I copied the project, then changed the project parameter, I then had to go to every single build configuration and "reset" the parameter.

Is there any way to specify the order of precedence for parameters, e.g. declare that a project parameter change should always override a build config value?

In fact, I think you might want to think about emulating the same process you have when deriving a build config from a template, and pop up a form to set and override project parameters when copying a project.

0
Comment actions Permalink

Yeah, this is really annoying. I have a dozen build configs in the project. The whole point of havign a project parameter for teh branch is to be able to simply copy the project and change the branch in one place. Having to go through all the build configs to reset the parameter is fail.

0

Please sign in to leave a comment.