-
Bug
-
Resolution: Duplicate
-
Minor
Right now we use Jenkinsfiles for all of our branches and we run these jobs across slaves.
Our master does no jobs, it's meant to just coordinate the slaves.
However because each branch is built, that means the master clones our entire repository per branch. This takes up a lot of disk space.
Is there a way to do a shallow clone on the master so that it only knows about the branch that it's building? It doesnt make sense to clone the whole repo per branch when the branch is a subset of the repo itself.
https://paste.fedoraproject.org/paste/bmZqN6-Mciz-oPhGuf1aKV5M1UNdIGYhyRLivL9gydE=
183M /var/lib/jenkins/workspace/redact-EKFU2VZFRWU4KXB4654FWURV2Q4AOPB2UXMBLUPEMX77NXWGZGDA@script 175M /var/lib/jenkins/workspace/lth_4636-product-to-service-R7DOH3YG2S3PCNRVQ4OHWJEQLMV4WUVPZJY6NXITQX7BCI63RAQQ@script 732K /var/lib/jenkins/workspace/redact-2DDF7H6TH77GDLANNM7J5JNMKMBXUZQGZUBSBQW7HKRZZDTOISYQ@script 175M /var/lib/jenkins/workspace/play-0-if-no-cases-for-year-YVL7UHVREPETGHMM6SUR7ZYDXOAYPWSLHTW24NKWJALUS5LGUXUQ@script 6.2G /var/lib/jenkins/
every branch is 175+MB on the master because each branch is a git clone. I'd like to only get the context of a branch on the master as well as the slave.
Also, on the slave I'm unsure how to do a shallow clone via Jenkinsfile DSL without specifying all of the other information, such as User credentials, credentials Id, etc.
I'd like to just have
node('ec2') { stage('Checkout') { checkout scm //something about adding shallow clone here } }
- duplicates
-
JENKINS-33273 Optimize Jenkinsfile loading and branch detection
-
- Resolved
-
- is related to
-
JENKINS-37658 Github-branch-source plugin should support git plugin extensions
-
- Closed
-
This seems like more of a request for help than a description of a bug report. There are only a very few people watching bug reports to the Jenkins git plugin. Please submit your questions to the Jenkins user mailing list so that it can be discussed there.
The shallow clone setting is passed from the multi-branch pipeline parent to the jobs which are created for it.
In your case, you may get the most benefit by using a reference copy of your large repository on the master node (and possibly on all the slave nodes). A reference copy can dramatically reduce disc use and time to clone a repository.
Refer to the first 5-10 minutes of this youtube video for hints and recommendations for managing large git repositories with the Jenkins git plugin.