【问题标题】:Jenkins Pull Request BuilderJenkins 拉取请求生成器
【发布时间】:2014-05-09 20:37:44
【问题描述】:

我为 Jenkins 设置了父子作业。父作业配置为在拉取请求上执行,子作业由父作业触发。

我的父作业配置,

在源代码管理部分下,

Repository URL: https://github.com/myorg/myrepo.git
Name: origin
Refspec: +refs/pull/*:refs/remotes/origin/pr/*
Branch Specifier (blank for default): ${sha1}

在构建部分下,

Trigger/call builds on other projects : 
Current build parameters
Pass-through Git Commit that was built

我的子作业配置,

在源代码管理部分下,

Repository URL: https://github.com/myorg/myrepo.git
Name: blank
Refspec: blank
Branch Specifier (blank for default): blank

问题:

子作业执行时出现错误,

父作业控制台,

00:00:00.249 Last Built Revision: Revision defghi (origin/pr/29/merge)
00:00:00.407 Fetching upstream changes from https://github.com/myorg/myrepo.git
00:00:02.237 Commencing build of Revision abcdef (origin/pr/28/merge)
00:00:02.247 Checking out Revision abcdef (origin/pr/28/merge)
00:00:02.843 Waiting for the completion of child
00:01:30.776 child #23 completed. Result was FAILURE

子作业控制台,

00:00:00.000 Started by upstream project "parent" build number 19
00:00:00.002 originally caused by:
00:00:00.002  GitHub pull request #28 of commit cdefgh automatically merged.
00:00:00.136 Last Built Revision: Revision bcdefg (detached)
00:00:01.101 Commencing build of Revision abcdef (detached)
00:00:01.151 Checking out Revision abcdef (detached)
00:00:01.317 FATAL: Could not checkout null with start point abcdef
00:00:01.317 hudson.plugins.git.GitException: Could not checkout null with start point abcdef
00:00:01.317    at hudson.plugins.git.GitAPI.checkoutBranch(GitAPI.java:863)
00:00:01.317    at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1192)
00:00:01.317    at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1176)
00:00:01.317    at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2394)
00:00:01.317    at hudson.remoting.UserRequest.perform(UserRequest.java:118)
00:00:01.317    at hudson.remoting.UserRequest.perform(UserRequest.java:48)
00:00:01.317    at hudson.remoting.Request$2.run(Request.java:326)
00:00:01.317    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
00:00:01.317    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
00:00:01.317    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
00:00:01.317    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
00:00:01.317    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
00:00:01.317    at java.lang.Thread.run(Thread.java:619)
00:00:01.317 Caused by: hudson.plugins.git.GitException: Error performing command: /usr/bin/git checkout -f abcdef
00:00:01.317 Command "/usr/bin/git checkout -f abcdef" returned status code 128: fatal: reference is not a tree: abcdef

知道如何解决这个问题吗?

【问题讨论】:

  • 这取决于您希望子作业做什么
  • 有完全相同的问题。有人有想法么?帕布,你有想过吗?

标签: github jenkins hudson jenkins-plugins hudson-plugins


【解决方案1】:

您还需要为子项目指定 refspec (+refs/pull/:refs/remotes/origin/pr/) 和分支说明符 (${sha1})。

【讨论】:

    猜你喜欢
    • 2015-09-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多