我尝试创建两个Jenkins作业,这两个作业都利用GitHub Pull Request Builder plugin来运行多个状态检查,但是我无法从下游作业中获取状态检查以显示在我的GitHub项目中。
以下是我想要设置的总结CI流程:
SUCCESS
,则应通过构建后操作调用下游作业第3步是我遇到问题的地方。 下游正常运行,但不会发布状态。我的GitHub项目设置的分支部分下的状态甚至不可用。我不确定GHPRB初始创建状态检查的方式,但是在控制台输出中有对上下文消息的引用:
14:58:23 Started by upstream project "upstream" build number 209
14:58:23 originally caused by:
14:58:23 GitHub pull request #114 of commit f1ff2819a5308f7819275e732cf44a2cc2ec31dc, no merge conflicts.
14:58:23 [EnvInject] - Loading node environment variables.
14:58:23 Building on master in workspace /store/jenkins/jobs/downstream/workspace
14:58:23 > git rev-parse --is-inside-work-tree # timeout=10
14:58:23 Fetching changes from the remote Git repository
14:58:23 > git config remote.origin.url <removed for privacy> # timeout=10
14:58:23 Fetching upstream changes from <removed for privacy>
14:58:23 > git --version # timeout=10
14:58:23 > git -c core.askpass=true fetch --tags --progress <removed for privacy> +refs/pull/*:refs/remotes/origin/pr/*
14:58:24 > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
14:58:24 > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
14:58:24 Checking out Revision eac390c51a1b8b591bfe879421bd5fad0421a1ec (refs/remotes/origin/master)
14:58:24 > git config core.sparsecheckout # timeout=10
14:58:24 > git checkout -f eac390c51a1b8b591bfe879421bd5fad0421a1ec
14:58:24 First time build. Skipping changelog.
14:58:24 [build] $ /store/jenkins/tools/hudson.tasks.Ant_AntInstallation/ant_1.8.2/bin/ant -DghprbStatusUrl= "-DghprbSUCCESSMessage=Packaging organization successfully cleaned" -DghprbStartedStatus=Undeploying -DghprbAddTestResults=false "-DghprbCommitStatusContext=Cleaning Packaging" "-DghprbERRORMessage=An error occurred during undeployment" -DghprbUpstreamStatus=true "-DghprbTriggeredStatus=Preparing destructive changes" "-DghprbFAILUREMessage=Packaging organization failed to clean properly" -DghprbShowMatrixStatus=false
以下是两个Jenkins工作的相关配置部分:
origin
+refs/pull/*:refs/remotes/origin/pr/*
${sha1}
✔︎
✔︎
Downstream
origin
+refs/pull/*:refs/remotes/origin/pr/*
*/master
✔︎
我错过了什么? 应该注意我没有安装Jobs DSL插件,所以我无法利用the extension that GHPRB provides。
答案 0 :(得分:12)
经过广泛的试验和错误,this comment阐明了我的问题。
ghprbGhRepository
,ghprbPullId
,ghprbActualCommit
和sha1
。两个作业的正确配置如下:
origin
+refs/pull/*:refs/remotes/origin/pr/*
${sha1}
✔︎
✔︎
Downstream
ghprbGhRepository=${ghprbGhRepository}
ghprbPullId=${ghprbPullId}
ghprbActualCommit=${ghprbActualCommit}
sha1=${sha1}
origin
+refs/pull/*:refs/remotes/origin/pr/*
${sha1}
✔︎