Hudson Git Plugin not working on windows
Asked Answered
A

2

8

I have msysgit installed with OpenSSH option. In Git bash, I can run ssh-agent, and it manages the passphrase for my ssh key. Is it possible for the Hudson Git plugin to use ssh-agent? Currently, it hangs when trying to clone, no doubt waiting for the passphrase to be entered.

Thanks!

Aposiopesis answered 6/7, 2010 at 17:34 Comment(0)
E
9

As mentioned in "Problem with Hudson + Git + Gitosis on windows", you need to make sure the Hudson job does set first a %HOME% environment variable.
That value must refer to the directory where you can find:

.ssh
  id_rsa     # private key
  id_rsa.pub # public key
Elodiaelodie answered 6/7, 2010 at 17:44 Comment(4)
Thanks, VonC. I've set %HOME% as a user environment variable. Wouldn't it pick this up? Also, as an experiment, I generated a new ssh key with blank passphrase, and hudson is still hanging. If I run the hudson git command from the command line, it succeeds in cloning the repo.Aposiopesis
@Jacko: it needs to be setup from the Hudson configuration settings to be extra sure. That would explain why Hudson jobs hang while command line Git commands pass.Elodiaelodie
Thanks you, sir!! I added a %HOME% parameter, wiki.hudson-ci.org/display/HUDSON/Parameterized+Build, and now it is cloning. Thanks again!!!!!!Aposiopesis
I cannot vote this answer up high enough. After HOURS of messing around with it this was the fix.Widget
R
1

I've just had this exact same problem but in my case setting HOME didn't fix it!

In my case the fix was actually to set the HOMEDRIVE and HOMEPATH variables so it would seem that different Windows Git builds (mine is version 1.8.1.msysgit.1) use different environment variables to locate SSH keys.

If in doubt, make sure you configure Hudson with all three!

Note also that you can configure Hudson-wide environment variables under 'Manage Hudson' > 'Configure System' > 'Global Properties', so you don't need to do this for each job individually.

Refer answered 24/4, 2013 at 11:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.