git clones on slaves

92 views
Skip to first unread message

moodysma sma

unread,
Aug 17, 2015, 9:06:56 PM8/17/15
to Jenkins Users
Hi,

I'm new to jenkins.  I want to understand what is the proper way to deploy git to slaves.  I have a git repo on a server, I want to build on a master node which is different from the git repo.  Then I want to deploy a clone repo on all the slaves.  Is it better to clone on the slaves or just transfer the files?  I'm able to checkout on the master from the repos but I can't seem to get the clones on the slaves working.  Any help would be appreciated.


Mark Waite

unread,
Aug 17, 2015, 9:39:37 PM8/17/15
to Jenkins Users
You could enable JGit as a git implementation from the master Jenkins configuration page, then use JGit as the implementation for your jobs.  That avoids deploying git on each slave.

JGit is not as full featured in the plugin as command line git, but it is sufficient for many uses.

Alternately, you can install command line git on each slave, then let the git plugin use its default, command line git.

Mark Waite

On Mon, Aug 17, 2015 at 7:07 PM moodysma sma <mood...@gmail.com> wrote:
Hi,

I'm new to jenkins.  I want to understand what is the proper way to deploy git to slaves.  I have a git repo on a server, I want to build on a master node which is different from the git repo.  Then I want to deploy a clone repo on all the slaves.  Is it better to clone on the slaves or just transfer the files?  I'm able to checkout on the master from the repos but I can't seem to get the clones on the slaves working.  Any help would be appreciated.


--
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/da8be4a7-3dd3-4af7-9e3c-5d4a21387127%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

moodysma sma

unread,
Aug 17, 2015, 11:02:18 PM8/17/15
to Jenkins Users
Hi, well I have git installed on each slave.  One of the questions I have is that once I do a git build on a slave or the master, it looks like it is using a git fetch rather than clone.  Why is this and how can I change it?  Subsequent builds still do a fetch.

Example:

Building remotely on NJ1TSTLQSAPP05 (WINDOWS DEV) in workspace e:\dev\apps\jenkins\workspace\GIS_deploy_git_all
 > c:\Program Files (x86)\Git\bin\git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > c:\Program Files (x86)\Git\bin\git config remote.origin.url file:////nj1tstlqsapp02//e//git//master # timeout=10
Fetching upstream changes from file:////nj1tstlqsapp02//e//git//master
 > c:\Program Files (x86)\Git\bin\git --version # timeout=10
using GIT_SSH to set credentials jenkins
 > c:\Program Files (x86)\Git\bin\git -c core.askpass=true fetch --tags --progress file:////nj1tstlqsapp02//e//git//master +refs/heads/*:refs/remotes/origin/*
Seen branch in repository origin/master
Seen 1 remote branch
Checking out Revision ecd16a407c5b95d06a8f955c40c8d8a5069cbad4 (origin/master)
 > c:\Program Files (x86)\Git\bin\git config core.sparsecheckout # timeout=10
 > c:\Program Files (x86)\Git\bin\git checkout -f ecd16a407c5b95d06a8f955c40c8d8a5069cbad4
 > c:\Program Files (x86)\Git\bin\git rev-list ecd16a407c5b95d06a8f955c40c8d8a5069cbad4 # timeout=10
[GIS_deploy_git_all] $ cmd /c call C:\Users\AppTSTJenkins$SVC\hudson7593801289004581285.bat

e:\dev\apps\jenkins\workspace\GIS_deploy_git_all>echo GIT Deploy Complete 
GIT Deploy Complete

Mark Waite

unread,
Aug 17, 2015, 11:11:23 PM8/17/15
to Jenkins Users
You can't change it from fetch to clone.  The plugin uses a fetch, then performs a checkout.

Why do you think you need to change it from fetch to clone?

moodysma sma

unread,
Aug 18, 2015, 8:06:52 PM8/18/15
to Jenkins Users
I wanted to understand the rationale, I guess clone will have more issues than fetch.
Reply all
Reply to author
Forward
0 new messages