Flows
Flows

Reputation: 3863

Jenkins Failed to connect to gerrit repository (Windows installation)

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

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:

Upvotes: 3

Views: 2777

Answers (1)

Flows
Flows

Reputation: 3863

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

Upvotes: 2

Related Questions