Pulling libraries to fixed location to avoid per-branch duplication

marjanvenema March 24, 2014

I have several projects which use code from a larger set of libraries. These libraries are under source control.

The libraries repository contains all the libraries used by all my projects and contains multiple versions of multiple libraries. Each library/version pair lives in its own folder. Each of my projects identifies the specific library/version pairs it needs through the folder paths of the references in its project file.

I have been of course been able to configure my build plan to pull the libraries repository. So far so good. However, using the auto branch management feature, this setup means that the entire libraries repository is replicated for each branch in all projects.

Not funny. No, really, not funny...

What I would like to do is:

  • pull the libraries repository in each build plan
  • but pull it to a fixed location that is the same for all build plans
  • it doesn't have to be an absolute path
  • but it does need to be outside the working directory of the current build plan

Unfortunately the `Checkout Directory` of the `Source Code Checkout configuration` task doesn't allow me to specify either an absolute path or a relative one that goes "up" for one or more levels from the working dir. The hint text explicitly states "(Optional) Specify an alternative sub-directory to which the code will be checked out." And indeed, specifying something like `..\Library` gets punished with the message "Checkout to parent directory is forbidden".

What would be the easiest and least complicated way to achieve my goal?

3 answers

0 votes
Samuel Clemens March 16, 2016

I have the same problem - with a repository weighing in at around 2GB.
I'd like to simply "git checkout myBranch" and "git clean -fxd" instead of cloning every time (which should save a lot of time and disk space).  However I also like Bamboo's automatic trigger with new branches showing up.

I'd love to be able to put "..\SharedDirectory" in the "CheckoutDirectory" for the
"Source Code Checkout" task but it won't let me go out above the \JOB_KEY\ folder

I'm considering replacing the Source Code Checkout task with the two git commands above.
That way I can specify exact when/where/how to do the checkout. 

0 votes
marjanvenema January 12, 2015

Nope. Gave up. Have had the same problem with other build server packages. It would seem that build server packages expect libraries to be installed on the server and not part of the build process. The idea has some merit, even for libraries that you develop yourself. But, while they indeed should have their own build process and release cycle, it does not necessarily follow that I should not be able to pull their source in the build of another piece of software.

0 votes
Raymond Bergen January 12, 2015

Have you by any chance managed to get this working? I was looking for the same solution

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events