3

好的,所以我在运行 Fedora 8 的 Hudson 服务器上克隆了我在 github 上的 repo 时遇到了一些问题。当 git 遇到错误时,输出是通常的错误输出:

Started by user anonymous
Checkout:workspace / /home/tomcat/.hudson/jobs/CIExample/workspace - hudson.remoting.LocalChannel@3861e6
Using strategy: Default
Checkout:workspace / /home/tomcat/.hudson/jobs/CIExample/workspace - hudson.remoting.LocalChannel@3861e6
GitAPI created
Cloning the remote Git repository
Cloning repository origin
$ git clone -o origin https://mattupstate@github.com/mattupstate/CIExample.git /home/tomcat/.hudson/jobs/CIExample/workspace
ERROR: Error cloning remote repo 'origin' : Could not clone https://mattupstate@github.com/mattupstate/CIExample.git
ERROR: Cause: Error performing git clone -o origin https://mattupstate@github.com/mattupstate/CIExample.git /home/tomcat/.hudson/jobs/CIExample/workspace
Trying next repository
ERROR: Could not clone from a repository
FATAL: Could not clone
hudson.plugins.git.GitException: Could not clone
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:587)
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:535)
    at hudson.FilePath.act(FilePath.java:753)
    at hudson.FilePath.act(FilePath.java:735)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:535)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1044)
    at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:479)
    at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:411)
    at hudson.model.Run.run(Run.java:1257)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:127)

构建并没有像某些人报告的那样挂起。它立即失败。此外,如果我登录到我的盒子,切换到 tomcat 用户(运行 Tomcat 和 Hudson 的用户),然后运行以下命令:

git clone -o origin https://mattupstate@github.com/mattupstate/CIExample.git /home/tomcat/.hudson/jobs/CIExample/workspace

它运行没有问题,并且 repo 被克隆。我手动运行该命令时遇到的唯一问题是工作区文件夹是否已经存在。当我要克隆到的本地文件夹已经存在时,Git 不喜欢它。我有一种感觉 Hudson 在尝试克隆之前正在创建该文件夹?

任何帮助,将不胜感激。

4

4 回答 4

1

我在 Hudson (v 2.2.1) 上从 git 检查项目时遇到了类似的问题。我之前使用的是颠覆,它在那里有现有的工作区。因此,当我配置 Git 时,我检查了选项“在构建之前清除工作空间”,并且在 hudson 上运行构建时,它清理了现有的工作空间并立即失败。我尝试运行几次,结果相同。

当我取消选中“构建前清除工作区”选项时,我的下一个构建和检查正常,没有任何问题。

有没有人用 git 在 hudson 上观察到这种行为。

于 2013-10-03T10:23:40.350 回答
0

我的 ssh:// git URL 出现此错误,问题是我没有安装 Hudson“SSH 插件”。

于 2011-10-12T18:18:10.690 回答
0

当您的 Hudson 作业服务器执行并尝试调用 git 命令时,您是否检查过您的路径?请参阅Git Hudson 插件
的“Gotcha”部分。

如果您看到指示 Git 无法克隆的输出,类似于下面的输出,请转到 Hudson 配置设置(不是项目设置,全局设置)并将 Git 路径更改为完全限定路径(例如,不是“ git”但是“ /usr/bin/git”或安装 Git 二进制文件的任何位置)。
如果您正在执行基于文件系统的克隆,您还应该验证权限是否正确。

于 2010-07-06T19:33:57.013 回答
0

我无法克隆ssh://git@github.com/x/y.git但可以克隆git://github.com/x/y.git,所以我猜 SSH 是问题所在。

于 2011-08-19T20:05:50.030 回答