Carcassi
Carcassi

Reputation: 93

How do I avoid cloudbees from cloning my github repository every time a job runs?

It seems that every time my jobs on cloudbees run, they get a "fresh" workspace. At that point, it needs to clone the git repository from github. The repository is quite large, and it takes tens of minutes to clone every time.

Is there a way to avoid this?

Upvotes: 0

Views: 122

Answers (1)

Jesse Glick
Jesse Glick

Reputation: 25461

If the same cloud slave is available to run your build as was used the last time, then your old workspace will be available, and Jenkins will just update your sources (something like git pull). But sometimes slaves are recycled or taken out of commission for various reasons and the workspace is discarded, in which case a fresh checkout will be performed.

There is nothing specific you can do to control this, though more frequently run jobs are less likely to need fresh checkouts.

(I am assuming there is simply a notice at the start of the build log that there was no existing checkout, and no Git-related error message giving a specific reason why the checkout could not be reused.)

Upvotes: 1

Related Questions