Jenkins can not clone Git repository over Git/SSH on Windows

后端 未结 8 1075
走了就别回头了
走了就别回头了 2020-12-13 20:06

I have successfully cloned Git repository in Jenkins over Git/SSH on Windows 2008 32-bit. When I tried to do the same on Windows 2008 64-bit, Console Output page ge

8条回答
  •  暖寄归人
    2020-12-13 20:45

    I've gone through these pains recently. Especially frustrating is the lack of error logs in this scenario: probably because MSysgit prompts user on the console when trying to recover - which doesn't get through Jenkins console.

    Based on my experience here are a few key elements to watch for:

    1. a mix of both Msysgit and Cygwin installed: MSysgit worked better for me- but I assume you're using that too
    2. some people have more luck with \cmd\git.cmd than \bin\git.exe
    3. making sure your slave runs as the same user (which is not the default upon service-based installs).. - oh I see you got that too
    4. setting HOME variable for windows slaves explicity
    5. basically make sure the same .ssh keys are reached when under Jenkins.
    6. for debugging, I found it useful to create a test job with no SCM, but run git clone in an "Execute shell/batch" build step. That should reveal a bit more info. BTW, you can do an env in the same step and maybe ls %HOME%/.ssh

    I think the above is what gave me a working a Windows 7 64bit Jenkins slave with git support - although I thought this had more to do with some other fine config detail than with 64 vs 32 bits. Good luck anyhow!

提交回复
热议问题