Jenkins与Git存储库的集成
我已经在centos服务器上安装了git 2.7。并在/srv/repo.git创建了存储库。我可以使用命令Jenkins与Git存储库的集成,git,jenkins,Git,Jenkins,我已经在centos服务器上安装了git 2.7。并在/srv/repo.git创建了存储库。我可以使用命令ssh://user@serverIP:/srv/repo.git 我已经在Windows 10上的本地计算机上安装了jenkins&git 问题: 与jenkins一起设置git repo时遇到错误。请查看屏幕截图。 错误: Failed to connect to repository : Command "git.exe ls-remote -h -- ssh://
ssh://user@serverIP:/srv/repo.git
Failed to connect to repository : Command "git.exe ls-remote -h -- ssh://username@server_ip:/srv/repo.git HEAD" returned status code 128:
stdout:
stderr: ssh: Could not resolve hostname server_ip: Name or service not known
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
请帮我做这个。提前感谢。您必须将“服务器ip”与服务器的ip交换 用户名也应该设置为正确的用户名。 你说过你可以像这样克隆
ssh://user@serverIP:/srv/repo.git
ssh://user@server_ip:/srv/repo.git
但詹金斯正试图这样克隆
ssh://user@serverIP:/srv/repo.git
ssh://user@server_ip:/srv/repo.git
我找到了这个问题的解决方案..在git服务器上出现了jenkins的身份验证问题。只需使用以下步骤解决问题:
您使用的是精确值
ssh://user@serverIP:/srv/repo.git
?或者您是否用您自己的服务器IP地址的值替换th,用repo名称替换repo
,等等?您能否从本地机器上的终端执行Jenkins发出的命令?逐字逐句。@evolutionxbox。。我正在用正确的值更改用户、服务器ip和repo。您可以试试@YSC的想法吗?@YSC.“执行Jenkins给出的命令”是什么意思。。?詹金斯给出了什么命令?引用OP:“我可以用这个命令克隆这个。”ssh://user@serverIP:/srv/repo.git。“是的,可能是因为无论出于什么原因,OP都可以解析‘serverIP’。但这并不意味着詹金斯也能做到这一点。此外,OP正在做两件不同的事情。他能用计算机克隆*user@serverIP“但詹金斯正在尝试克隆”user@server_ip“那不一样;)@YSC然后OP自相矛盾-只有两种可能性,server\u IP
可以解决也可以不解决。我同意这个问题不好,但这并不能让这个答案变得好。你在做假设,你可以向OP询问精确度,或者将问题标记为低质量。