Jenkins plus git on the same server

I have a home server with git repositories. Now I'm trying to configure Jenkins on existing PHP repositories.

I installed Jenkins normally, but I get an error when creating a Job:

Repository URL = / home / git / repositories / testing.git

Error:

Failed to connect to the repository: the command "git ls-remote -h / home / git / repositories / testing.git HEAD" returns a status code of 128: stdout: stderr: fatal: '/home/git/repositories/testing.git' not makes it seem like this git repository is fatal: the remote end hung up unexpectedly

Help solve this problem.

Thanks.

PS I'm even trying to put the url that I use to remotely clone the repo:

SSH: // git @ 192.168.1.110: /testing.git

But I still get the error:

Failed to connect to the repository: the command "git ls-remote -h ssh: // git @ 192.168.1.110: /testing.git HEAD" returns a status code of 128: stdout: stderr: ssh: Failed to resolve the host name 192.168.1.110: : Name or service not known fatal: remote end unexpectedly hung up

+4
source share
2 answers

I solved my problem:

1) add secret key in .ssh for user jenkins

2) set Credential Management in Jenkins to access the .ssh folder

+2
source

The first problem is if jenkins is installed on the same computer and test.git is visible, check the url. You will not see a red warning message if the repo is available.

The only thing I can think of is that /home/git might be on a different server / mount point (maybe a NAS?)


The second problem, cloning using SSH is to remove : (colon) after the IP address and make sure you provide the full path to the repo

+2
source

Source: https://habr.com/ru/post/1492593/


All Articles