Jenkins Failed to connect to gerrit repository (Windows installation)

蓝咒 提交于 2019-12-01 06:29:19

问题


I looked around Stackoverflow and google a lot but I am not able to solve my issue.

My aim : I want to set up Jenkins to use git SCM to clone a repository host by gerrit

My Jenkins config

  • Jenkins version 2.7.1 running on windows as a service
  • Git plugin version 2.5.3
  • Multiple SCM plugin version 0.6
  • Gerrit Trigger plugin version 2.21.1

The issue

The URL is configured as IHM@IP:/path/to/gerrit/git/IHM.git. IHMis the user which launched Jenkins on a windows server. IPis the adress of the red hat server hosting gerrit.

Credentials are set to use user IHM with the ssh key enter directly. The key has been generated using PuttyGen on the windows server. I didn't set up the ssh key on a config on windows server. Do I have to do it ?

I have the following error, but I am able to run the command prompt on the windows server with user IHM (it ask me the password but then it works).

Failed to connect to repository : Command "C:\Program Files\Git\bin\git.exe -c core.askpass=true ls-remote -h IHM@IP:/path/to/gerrit/git/IHM.git HEAD" returned status code -1:

stdout:

stderr:


回答1:


I finally managed to set up the repository by setting up again from scratch.

Here is my config, for example to others:

  • user = The user I used to connect to gerrit
  • IP = Gerrit serveur IP adress
  • Repository URL = ssh://user@IP:29418/IHM.git > Do not put the entire path
  • Credentials are used with the private key generated with Putty and which public key is configure to gerrit
  • Refspec = refs/changes/:refs/changes/
  • Branches to build = $GERRIT_REFSPEC


来源:https://stackoverflow.com/questions/38761745/jenkins-failed-to-connect-to-gerrit-repository-windows-installation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!