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
. IHM
is the user which launched Jenkins on a windows server. IP
is 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:
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