[英]Github Pull Request Plugin
I'm trying to setup the pull request plugin. 我正在尝试设置拉请求插件。 I've configured it as suggested in the documentation but if I specify the branch to build as ${sha1} then that variable doesn't seem to be resolved. 我按照文档中的建议配置了它,但如果我指定要构建为$ {sha1}的分支,则该变量似乎无法解析。 So in my logs: 所以在我的日志中:
Building in workspace /Users/sat/.jenkins/jobs/JenkinsTest/workspace
> /usr/local/bin/git rev-parse --is-inside-work-tree
Fetching changes from the remote Git repository
> /usr/local/bin/git config remote.origin.url git@githubenterprise.parc.com:stucker/tester.git
Fetching upstream changes from git@githubenterprise.parc.com:stucker/tester.git
> /usr/local/bin/git --version
> /usr/local/bin/git fetch --tags --progress git@githubenterprise.parc.com:stucker/tester.git +refs/pull/*:refs/remotes/origin/pr/*
> /usr/local/bin/git rev-parse origin/${sha1}^{commit}
> /usr/local/bin/git rev-parse ${sha1}^{commit}
But I don't know why that wouldn't work. 但我不知道为什么那不起作用。 This is coming off of a push triggered by the standard web hook 这是由标准Web钩引发的推动
I found that you can't run the regular build hook and the pull request on the same job - I had to have separate jobs - one for doing a regular build, and one for doing a pull request build. 我发现你不能在同一个工作上运行常规构建钩子和拉取请求 - 我必须有单独的工作 - 一个用于进行常规构建,一个用于执行拉取请求构建。 With that everything works fine. 一切正常。
If you get 如果你得到
Failed to rev-parse: origin/${sha1}
No candidate revisions
, it could be related to issue 5 . ,它可能与问题5有关 。
A couple of suggestions: 一些建议:
5#issuecomment-14308061 : 5#issuecomment-14308061 :
I just had the same issue with v1.5 and I got it solved by cloning the job and deleting the old one. 我刚刚遇到了与v1.5相同的问题,我通过克隆工作并删除旧工作来解决问题。
5#issuecomment-19826662 : 5#issuecomment-19826662 :
In my case, " Branches to build
" field in jenkins configuration form was like " feature/abc/main
". 在我的例子中,jenkins配置表单中的“ Branches to build
”字段就像“ feature/abc/main
”。 My colleague @defragged
has suggested to specify branch name without forward slashes (" /
"). 我的同事@defragged
建议指定没有正斜杠(“ /
”)的分支名称。 So I checked out new branch " abcMain
" of "feature/abc/main" and build the job. 所以我检查了“feature / abc / main”的新分支“ abcMain
”并构建了这个工作。 It worked for me. 它对我有用。
5#issuecomment-24628027 : 5#issuecomment-24628027 :
I was having the same problem with a Github Pull Request job, and it turned out I was missing the necessary refspec " +refs/pull/:refs/remotes/origin/pr/
" from my job. 我在Github Pull Request工作中遇到了同样的问题,结果发现我错过了必要的refspec“ +refs/pull/:refs/remotes/origin/pr/
”。
JENKINS-20502 "Cannot find any revision to build on clean workspace" (which doesn't seem to be in included in a Jenkins release yet) JENKINS-20502 “无法找到任何修改以构建在干净的工作空间”(这似乎还没有包含在Jenkins版本中)
Other open issues for the GitHub pull request builder plugin (repo janinko/ghprb
, forked at jenkinsci/ghprb-plugin ), like issue 17097 . GitHub拉请求构建器插件的其他未解决的问题 (repo janinko/ghprb
,分叉在jenkinsci / ghprb-plugin ),如问题17097 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.