Git和Jenkins在同一台服务器上

问题描述

这是一台没有Internet连接的私人Centos 7服务器。我想将Jenkins(2.235.2)与Git(2.9.4)集成,问题是存储库URL显示错误

对于jenkins用户,我尝试了控制台日志中提到的fetch命令,它能够毫无问题地进行获取

我已采取的措施-

  1. 为Jenkins上的可执行文件提供Git路径
  2. 由Jenkins用户制作了SSH密钥,为特定存储库提供了公共密钥,并且还在Jenkins中为“管理凭据”添加了凭据。
  3. 因为它是本地git存储库,所以我已经在存储库URL中尝试过file://命令

没有制定出措施

用户trpuser启动 作为系统运行 在工作空间/ var / lib / jenkins / workspace / o中构建 使用凭证b5a7876d-46db-4930-86a1-0204c888fb11 首先清除工作空间。 克隆远程Git存储库 克隆仓库root @ localhost:/ path / to / git

/ usr / local / git / bin / git init / var / lib / jenkins / workspace / o#超时= 10 从root @ localhost:/ path / to / git获取上游更改 / usr / local / git / bin / git --version#超时= 10 git --version#'git版本2.9.4' 使用GIT_ASKPASS设置凭据 / usr / local / git / bin / git fetch --tags --progress-root @ localhost / path / to / git + refs / heads / :refs / remotes / origin / #timeout = 10 错误:克隆远程存储库“源”时出错 hudson.plugins.git.GitException:命令“ / usr / local / git / bin / git fetch --tags --progress-root @ / path / to / git + refs / heads / :refs / remotes / origin / ”返回的状态码128: 标准输出: stderr:权限被拒绝,请重试。 收到与本地主机的断开连接:2:根身份验证失败太多 致命:无法从远程存储库读取。

请确保您具有正确的访问权限 并且存储库存在。

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2450)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2051)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:84)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:573)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:802)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1132)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1177)
at hudson.scm.SCM.checkout(SCM.java:505)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1206)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
at hudson.model.Run.execute(Run.java:1880)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:428)

错误:克隆远程存储库“源”时出错 完成:失败

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)