I'm having a hard time configuring Jenkins, running as a Windows Service, to connect to a git server (gitosis) and clone a repository. Jenkins is set to use the standard Git plugin.
Everything is hosted by us: the Jenkins server is on win.foo.com
and gitosis is running on a linux server (git.foo.com
).
If I RDP into win.foo.com
I can clone (git.exe clone --progress -o origin [email protected]:myproject.git myproject
) from the command line without issue.
Jenkins is running as a service and because it's not running under the same user account I've copied the .ssh
folder to %SystemRoot%\System32\config\systemprofile
(as defined in the %USERPROFILE%
environment variable) and C:\Program Files (x86)\Git\
, but neither of these seem to be picked up by Jenkins, even after a full restart.
I've tried using both git.exe
and git.cmd
; no joy in either case.
Jenkins is failing with the following error message:
ERROR: Error cloning remote repo 'origin' : Could not clone [email protected]:myproject.git
ERROR: Cause: Error performing command: C:\Program Files (x86)\Git\cmd\git.cmd clone --progress -o origin [email protected]:myproject.git C:\Program Files (x86)\Jenkins\jobs\myproject\workspace
Command "C:\Program Files (x86)\Git\cmd\git.cmd clone --progress -o origin [email protected]:myproject.git C:\Program Files (x86)\Jenkins\jobs\myproject\workspace" returned status code 128: Cloning into C:\Program Files (x86)\Jenkins\jobs\myproject\workspace...
Access denied
fatal: The remote end hung up unexpectedly
I'm sure I've missed something, but I'm not sure what.
Advice?