We have a reasonably large git repository (about 8Gb) with many different projects in it. I want Jenkins to be able to build each project without each project having to clone the whole repo for each project.
We have recently switched from SVN to git, and I am updating Jenkins to use git. With SVN I could simply do a partial checkout to get what I needed for each project. I've been told that we are not splitting up the large git repo into smaller ones.
As far as I can tell there are three approaches:
- A git clone for each project. Simplest, but uses a large amount of space. We'd like to avoid this one if possible.
- A single 'main' git clone, with each project local-cloning from that (and git can save space using hard links - this is on Linux). This seems quite complicated to setup and to get Jenkins to recognise changes that need building.
- A way to have no local clones, but to just get the files needed for each project directly from the remote. Not sure how this would work though.
Are there viable options that I've missed? Which is the best option?
This is similar to Jenkins: How To Build multiple top-level projects from a git repository? but, I think, different enough that this question is worth asking.