Jenkins在同一台服务器上加上Git [英] Jenkins plus Git on same server
问题描述
我有家庭服务器与git存储库。
现在我试图通过现有的PHP回购配置Jenkins。
我已经正常安装Jenkins,但是在创建作业时出现错误:
存储库网址= /home/git/repositories/testing.git
错误如下:
无法连接到存储库:命令git ls-remote -h
/home/git/repositories/testing.git HEAD返回状态码128:
stdout:stderr:fatal:'/home/git/repositories/testing.git'不是
似乎是一个git仓库致命:远程终端意外挂起
请帮助解决此问题。
谢谢。
PS我甚至试图把我使用的URL远程克隆回购:
ssh://git@192.168.1.110:/ testing .git
但我仍然收到错误消息:
无法连接到存储库:命令git ls-remote -h
ssh://git@192.168.1.110:/testing.git HEAD返回状态码128:
stdout: stderr:ssh:无法解析主机名192.168.1.110 ::名称
或服务未知致命:远程端意外挂断
我解决了我的问题:
1)将私钥放在.ssh中用于jenkins用户
2)在Jenkins中设置管理凭证以访问.ssh文件夹
I have home server with git repositories. Now I'm trying to configure Jenkins over existing PHP repos.
I've install Jenkins normally but I'm getting the error while creating the Job:
Repository URL = /home/git/repositories/testing.git
Error is following:
Failed to connect to repository : Command "git ls-remote -h /home/git/repositories/testing.git HEAD" returned status code 128: stdout: stderr: fatal: '/home/git/repositories/testing.git' does not appear to be a git repository fatal: The remote end hung up unexpectedly
Please help to resolve this problem.
Thank you.
P.S. I even tries to put URL that I'm using to clone repo remotely:
ssh://git@192.168.1.110:/testing.git
But I'm still getting error:
Failed to connect to repository : Command "git ls-remote -h ssh://git@192.168.1.110:/testing.git HEAD" returned status code 128: stdout: stderr: ssh: Could not resolve hostname 192.168.1.110:: Name or service not known fatal: The remote end hung up unexpectedly
I solved my problem:
1) put private key in .ssh for jenkins user
2) set Manage Credentials in Jenkins to access .ssh folder
这篇关于Jenkins在同一台服务器上加上Git的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!