简体   繁体   English

无法从詹金斯的git插件连接到git服务器仓库

[英]cannot connect to git server repo from git plugin in jenkins

This can be found repetitive one but I am not getting solution even after exploring similar question. 可以发现这是重复的,但是即使在探索了类似的问题之后我也没有得到解决。 I have setup Gitlab and Jenkins on same server with I have installed plugin for git. 我在同一服务器上安装了Gitlab和Jenkins,并安装了git插件。 Getting error for different tried combinations URL with credentials. 带有凭据的其他尝试组合URL出现错误。

URL tried: 尝试的网址:

/var/opt/gitlab/git-data/gitlab-satellites/root/myproject.git
git@localhost:8077/root/myproject.git
http://<myIP or localhost or 127.0.0.1>:8077/root/myproject.git

Credentials used
root user
created one new user from jenkins
gitlab user who is member for same project.

Or Does it sounds due to proxy issue? 还是听起来是由于代理问题? Or due to some user management or permissions? 还是由于某些用户管理或权限?

Anything you want more please comment. 您想要更多的东西请发表评论。 I request help for same. 我要求同样的帮助。 在此处输入图片说明

For the error displayed in your capture, if you want to connect your jenkins to a local Git repository, then you should use the file:// protocol. 对于捕获中显示的错误,如果要将jenkins连接到本地Git存储库,则应使用file://协议。 In your case, it should be : file:///var/opt/gitlab/git-data/gitlab-satellites/root/myproject.git 在您的情况下,应为: file:///var/opt/gitlab/git-data/gitlab-satellites/root/myproject.git

But, if the gitlab instance is running and serving git repositories, you should be able to use the http://127.0.0.1:8077/root/myproject.git (which is probably the url you get when going on the default page of the gitlab project) (it should works, I have the same config here, and it works flawlessly). 但是,如果gitlab实例正在运行并正在提供git存储库,则您应该可以使用http://127.0.0.1:8077/root/myproject.git (这可能是您在默认页面上获得的url gitlab项目)(它应该工作,我在这里有相同的配置,并且可以完美地工作)。

Yet, if jenkins is still not able to do the extraction, try to do it alone, by using the standard git clone command on the server : git clone http://127.0.0.1:8077/root/myproject.git . 但是,如果jenkins仍然无法执行提取操作,请尝试使用服务器上的标准git clone命令单独进行提取: git clone http://127.0.0.1:8077/root/myproject.git It will probably give you more detailled errors if something is badly configured. 如果某些配置不正确,它可能会给您更多详细的错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM