SRKprakash
SRKprakash

Reputation: 113

How to speed up git pulling triggered using jenkins?

This is a xamarin mobile application of size more than 2 GB. My lead was able to build it using MSBuild. I am given the task of automating the build using Jenkins with MSBuild as plugin. Since this is a very big application, git pulling has already taken more than one hour and the task progress bar is showing around 95%.

Question 1) How can I speed up this jenkins/git pulling process?

I am working on the client's virtual machine and internet speed is fairly good

I am sharing my jenkins console here enter image description here

Thanks in advance

Upvotes: 3

Views: 5104

Answers (2)

grayaii
grayaii

Reputation: 2444

If you have a fast local network but a slow internet network, you can keep a copy of the checkout on your local network somewhere, and have your build copy it into your workspace and run "git pull" followed by "git checkout BRANCH". This is not ideal because you lose the "changes" between builds, but if that's not important for you, that may do the trick. Another idea would be to NOT delete the workspace, and simply do a "clean before checkout". Ideally, you want to do what @ElpieKay suggested though. I'm just throwing out an alternative.

Upvotes: 0

ElpieKay
ElpieKay

Reputation: 30868

  1. shallow clone

    You can specify --depth=<n> for git clone. The point is to reduce the data to be fetched. This does not work well for a repository that has new binary files added continously.

  2. reference clone

    First make a full clone as the reference repository in a directory which the jenkins job can access. Then add --reference <path_of_the_reference_repository> for git clone. Update the reference repository regularly, maybe twice a week or so, depending on your needs. The point is to reuse any data that already exist in the reference repository, only to fetch the data that don't exist locally.

Upvotes: 6

Related Questions