Using <TC-agent-root>/system/git in own build jobs


We have to clone a larger number of common GIT repositories in a number of jobs. Thus it would therefore be a good idea to keep the .git part between the jobs in the same manner as the agent does with repositories in ROOT/system/git.

Question: is it ok to use this folder for our own repositories with the proper management of the map file? Will the repositories be cleaned up?

Comment actions Permalink

It is not generally recommended to make changes to the map file. Maybe there is another way to accomplish your objective? However, I'm not sure I completely understand what it is you're trying to do.

Are you hoping to clone and manage some repositories into your TeamCity cache using a separate tool? Do you just want to check them out to a shared resource where all of your build agents can access it? Or something else? Tell me a bit more about your use case and perhaps there is already a feature that might work for you.


Comment actions Permalink

[Thanks for the quick answer]

We have a number of Git repositories that are used in many different jobs. We don't know which tag, branch or commit ID to check-out before the run (that takes some non-trivial computations to figure out), so we cannot "just" add the repos as additional VCS for the build configuration.

But, as at least one the repositories is rather big, we would really prefer not to clone it in every build job, but rather to have a "bare repository" in system/git and do the usual pull+checkout dance.

Which means we would like to modify (add to) the system/git/map file.

Alternatively, we can invent the same mechanism in a separate folder on the agent - like ROOT/oticon/git or whatever - but then we wil also have to do some clean-up for the repositories when there are no longer used in the builds.

Comment actions Permalink

I cannot recommend modifying the map file. Any modifications would be unexpected and may not be handled by the TeamCity service, which could lead to unexpected behavior. 

Have you looked into using Server-Side Checkout rather than Agent-Side Checkout?


Please sign in to leave a comment.