Pulling libraries to fixed location to avoid per-branch duplication

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

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

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.

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. 

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in United States

Topic Tuesday: What's your favorite topic?

Good morning All, Our goal is to get you into the habit of while enjoying your favorite morning drink you are checking the NOVA "space" for topics and comments. Your input is really needed and...

57 views 4 0
View post

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you