Nicholas Albion
Nicholas Albion

Reputation: 3284

Configure GitLab repository in Jenkins

I'm trying to configure Jenkins (running on Windows Server 2008) to connect to a GitLab 6.0 repository (on a linux box).

From my local windows box I can use the SSH URLs to clone the projects on my GitLab server. I've had some issues using the HTTP URLs, but I did manage to connect using HTTP with authentication using the Eclipse plugin.

Failed to connect to repository :

Command "d:\tools\Git\bin\git.exe ls-remote -h http://myserver.domain/mygroup/myproject.git HEAD"

returned status code 128:

stdout: stderr: error: The requested URL returned error: 504 while accessing

http://myserver.domain/mygroup/myproject.git/info/refs?service=git-upload-pack

fatal: HTTP request failed

When I try this URL in a browser I get an authentication popup. If I enter my email & password I can successfully download the list of branches & tags.

...nope:

http://username:password@myserver.domain/mygroup/myproject.git/info/refs not valid: is this a git repository?

Jenkins immediately reacts:

stderr: ssh: myserver.domain:mygroup: no address associated with name

fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

Upvotes: 5

Views: 15955

Answers (1)

VonC
VonC

Reputation: 1329092

As I commented:

Maybe Jenkins doesn't support the scp syntax (with ':') Try

 ssh://git@myserver.domain/mygroup/myproject.git

As mentioned in ".ssh config with amazon ec2 and git", using ':' usually involves a ~/.ssh/config file, which resolves the string preceding the ':' into a server, user, port and ssh key.

Jenkins might understand better git@myserver.domain/mygroup/myproject.git instead of git@myserver.domain:mygroup/myproject.git.

Upvotes: 2

Related Questions