Jenkins Docker 0.9beta plugin. How to stop Jenkins Slave from Cloning the Git repos each time- How to re-use workspace?

45 views
Skip to first unread message

krishna kunapuli

unread,
Apr 24, 2015, 11:18:02 AM4/24/15
to jenkins...@googlegroups.com
Hi,
 I was able to setup Jenkins running in a docker container and configure plug-in to kick off builds on slaves. How ever, each time a job is run jenkins slave container is trying to clone the entire git repository, downloading all the artifacts for the project. In my case it take 15minutes. This is least efficient. How do I re-use a slave workspace?

Thanks,
K

Nigel Magnay

unread,
Apr 24, 2015, 12:59:08 PM4/24/15
to jenkins...@googlegroups.com
Build a slave image with a copy of the git repository and any known artifacts within it. Then the build will only be fetching the diffs.


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/d452c5d9-0cbd-43ce-af5b-62e9b0edfb36%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mark Waite

unread,
Apr 24, 2015, 1:06:09 PM4/24/15
to jenkins...@googlegroups.com
Another alternative is to build a slave image with a bare copy of the git repository, then use that bare copy as a reference repository in the job definition (see the "Additional Behaviours" section of the git section of the job configuration).  The reference repository reduces the data transfer by pointing to the bare repo and only pulling new changes.

Mark Waite

krishna kunapuli

unread,
Apr 24, 2015, 3:45:16 PM4/24/15
to jenkins...@googlegroups.com
I took a ssh ready slave image and sudo-ed to the container as jenkins, ran git clone,  ran a basic build and committed to docker. When I run a docker container from this new image. I could see the files in there. I don't see expected result of just git update when I use this new image as my slave. 

Additional note, I inspected the dynamic containers created by jenkins and don't see source directory. I don't understand what I am missing.
Reply all
Reply to author
Forward
0 new messages