11

我正在尝试从 github 获取一个只读的 git 存储库,并通过 hudson 构建它。这个过程失败了。

这是哈德逊输出:

Started by an SCM change
Checkout:workspace / d:\hudson\home\jobs\gdcm-hudson\workspace - hudson.remoting.LocalChannel@19ba1d8
Using strategy: Default
Checkout:workspace / d:\hudson\home\jobs\gdcm-hudson\workspace - hudson.remoting.LocalChannel@19ba1d8
GitAPI created
Fetching changes from the remote Git repository
Fetching upstream changes from git://github.com/malaterre/gdcm.git
[workspace] $ "C:\Program Files (x86)\Git\bin\git.exe" fetch -t git://github.com/malaterre/gdcm.git +refs/heads/*:refs/remotes/origin/*
[workspace] $ "C:\Program Files (x86)\Git\bin\git.exe" ls-tree HEAD
ERROR: Problem fetching from origin / origin - could be unavailable. Continuing anyway
ERROR: Could not fetch from any repository
FATAL: Could not fetch from any repository
hudson.plugins.git.GitException: Could not fetch from any repository
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:674)
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:641)
    at hudson.FilePath.act(FilePath.java:753)
    at hudson.FilePath.act(FilePath.java:735)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:641)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1061)
    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:1273)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:129)

当我直接通过 git bash 命令行运行该 fetch 命令时,我没有得到任何响应(我认为这意味着它有效)。

我查看了这个可能的解决方案: http://issues.hudson-ci.org/browse/HUDSON-7141?page= com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel

但是使用该版本的插件并没有改变这种行为。

我什至还没有让它与 cmake 一起工作,只是一直下载。我怎样才能让它工作?

编辑:这个问题不是问题克隆/获取存储库使用 Git 插件 for Hudson on Windows的重现,因为我没有在服务器上作为服务运行。

4

4 回答 4

8

是的,我刚刚解决了这个确切的问题。如果您打开一个 Windows 资源管理器,d:\hudson\home\jobs\gdcm-hudson\workspace您应该能够看到一个.git目录,而没有其他任何东西。应该有一个工作副本,但没有。要解决此问题,您必须通过运行“启动”存储库

git pull git://github.com/malaterre/gdcm.git

这应该会在 .git 目录旁边创建一堆其他文件,d:\hudson\home\jobs\gdcm-hudson\workspace并且您应该能够在 hudson 中执行构建。

于 2010-12-14T21:09:44.263 回答
5

这发生在我以前工作正常的构建中。解决方案只是删除工作区目录并重新启动构建。

于 2011-10-31T05:42:42.793 回答
2

Hudson 的 Git 插件最近才因此类错误消息(问题 6902,2010 年 7 月)而失败。在它过去常常默默地进行之前(这是误导性的)。

您是否定义了任何子模块?
因为它看起来像Git Plugin Bug 4

我有以下设置:

  • 一个名为“master”的分支,其中包含另一个项目的子模块
  • 一个名为“develop”的分支,不包含子模块引用

如果我将 Hudson 作业配置为构建/测试“开发”分支,则构建会中断,因为它无法进行子模块检出。因为这发生在切换到“开发”分支之前,所以构建在任何开始之前就被破坏了。

解决方案

我假设git ls-tree HEAD扫描 160000 个引用的输出以确定哪些条目是子模块。我想在大多数情况下,那时
的 refHEAD仍然指向。 而不是'ing ,也许在指定的分支上做?master
ls-treeHEAD

于 2010-09-14T04:10:20.380 回答
0

作为记录,就我而言,问题在于配置了一个特殊的 Git 可执行文件(在全局 Hudson 设置中)。由于缺少库,此可执行文件无法在我的某些构建主机上运行。当使用 /usr/bin/git 时,它起作用了。

所以看起来所描述的错误消息确实可以指示任何Git 错误。

于 2015-01-28T15:42:23.113 回答