【问题标题】:How to integrate code repository hosted on gerrit to jenkins?如何将托管在gerrit上的代码库集成到jenkins?
【发布时间】:2019-01-26 05:32:25
【问题描述】:

我的项目代码托管在 git 和 gerrit 上。我想将 gerrit 与 jenkins 集成。当我在源代码管理部分(Jenkins)中输入 SSH 路径或 HTTP 路径时,出现以下错误

错误:

由计时器启动 在工作区 /var/lib/jenkins/workspace/demo 的 master 上构建 [WS-CLEANUP] 正在删除项目工作区... [WS-CLEANUP] 完成 克隆远程 Git 存储库 克隆仓库http://sushma@10.1.1.200:29418/Test_AutomationHEAD

git init /var/lib/jenkins/workspace/demo # timeout=10 从http://sushma@10.1.1.200:29418/Test_Automation HEAD 获取上游更改 git --version # timeout=10 使用 GIT_ASKPASS 设置凭据 git fetch --tags --progress http://sushma@10.1.1.200:29418/Test_Automation HEAD +refs/heads/:refs/remotes/origin/ 错误:10 分钟后超时 错误:克隆远程 repo 'origin' 时出错 hudson.plugins.git.GitException:命令“git fetch --tags --progress http://sushma@10.1.1.200:29418/Test_Automation HEAD +refs/heads/:refs/remotes/origin/”返回状态码 143: 标准输出: 标准错误: 在 org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2016) 在 org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1735) 在 org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access 300 美元(CliGitAPIImpl.java:72) 在 org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:420) 在 org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:629) 在 hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1146) 在 hudson.plugins.git.GitSCM.checkout(GitSCM.java:1186) 在 hudson.scm.SCM.checkout(SCM.java:504) 在 hudson.model.AbstractProject.checkout(AbstractProject.java:1208) 在 hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574) 在 jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) 在 hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499) 在 hudson.model.Run.execute(Run.java:1798) 在 hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) 在 hudson.model.ResourceController.execute(ResourceController.java:97) 在 hudson.model.Executor.run(Executor.java:429) 错误:克隆远程 repo 'origin' 时出错 完成:失败

【问题讨论】:

    标签: git jenkins gerrit


    【解决方案1】:

    您正在使用 http 从 29418 端口进行克隆。将存储库 URL 更改为:

    ssh://sushma@10.1.1.200:29418/Test_Automation
    

    或者:

    http://sushma@10.1.1.200/Test_Automation
    

    如果您对在“git clone”命令中使用的正确存储库 URL 有疑问:

    • 转到 Gerrit 服务器 Web 界面
    • 点击项目 > 列表
    • 搜索 Test_Automation 项目
    • 点击项目名称
    • 点击常规标签
    • 查看http和ssh“git clone”命令

    【讨论】:

    • 下面是 gerrit 的克隆命令。 git clone sushma@10.1.1.200:8080/Test_Automation
    • 当我使用上面的 URL 与 jenkins 集成时出现以下错误无法连接到存储库:命令“git ls-remote -h ssh://sushma@10.1.1.200:29418/Test_Automation HEAD”返回状态码 128:stdout:stderr:主机密钥验证失败。致命:无法从远程存储库读取。请确保您具有正确的访问权限并且存储库存在。
    猜你喜欢
    • 1970-01-01
    • 2018-06-11
    • 1970-01-01
    • 1970-01-01
    • 2014-06-08
    • 1970-01-01
    • 2011-01-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多