4

我想配置 hudson+git 并想创建一个构建。但我得到以下异常:

Started by user nitish
Checkout:workspace / /root/.hudson/jobs/NightlyGit/workspace - hudson.remoting.LocalChannel@dd7efd
Using strategy: Default
Checkout:workspace / /root/.hudson/jobs/NightlyGit/workspace - hudson.remoting.LocalChannel@dd7efd
Fetching changes from the remote Git repository
Fetching upstream changes from https://github.com/test/eng.git
ERROR: Problem fetching from origin / origin - could be unavailable. Continuing anyway
ERROR:  (Underlying report) : Error performing command: /usr/bin/git fetch -t https://github.com/test/eng.git +refs/heads/nightly:refs/remotes/origin/nightly
Command "/usr/bin/git fetch -t https://github.com/test/engile.git +refs/heads/nightly:refs/remotes/origin/nightly" returned status code 128: error: The requested URL returned error: 401 while accessing https://github.com/test/eng.git/info/refs

fatal: HTTP request failed

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$3.invoke(GitSCM.java:887)
    at hudson.plugins.git.GitSCM$3.invoke(GitSCM.java:845)
    at hudson.FilePath.act(FilePath.java:758)
    at hudson.FilePath.act(FilePath.java:740)
    at hudson.plugins.git.GitSCM.gerRevisionToBuild(GitSCM.java:845)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:622)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1483)
    at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:507)
    at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:424)
    at hudson.model.Run.run(Run.java:1366)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:145)

我是 git 的新手,我不知道确切的问题是在将 git 与 hudson 一起使用时是否需要任何凭据?现在我已经创建了 hudson 作业并提供了 git 存储库链接,但它抛出了异常。有人可以帮我解决这个问题。

4

2 回答 2

2

我已经在 hudson 服务器上创建了 SSH 密钥并将其添加到我的 github 帐户中,从而解决了我的问题。

于 2013-01-24T05:03:24.150 回答
2

试试这个:

  1. 转到作业的“配置”页面。

  2. Source Code ManagementGitAdditional Behaviors下,添加行为“ Wipe out repository & force clone ”:

在此处输入图像描述

在此处输入图像描述

  1. 点击保存按钮。

  2. 再次尝试构建

于 2019-01-06T14:29:05.573 回答