github - Jenkins github 拉取请求构建器插件未发布到 github

标签 github jenkins jenkins-plugins pull-request

我已经配置了 Jenkins Github 拉取请求构建器插件来构建我机构成员提出的每个拉取请求。它就像一个魅力。

但是,构建并没有像在这个不错的 post 中显示的那样将构建状态报告回 github。 .我还尝试选中“更新提交状态失败时使用评论报告结果”框,但我仍然没有在 github 上得到任何返回。

我在 GitHub 上创建了一个 bot 用户,并赋予它对 repo 的推送和管理权限。

我的 Jenkins 服务器位于防火墙后面,但由于它正在正常构建并检测对 github 存储库的更改(通过轮询),我认为这不是问题。

其他人有这个问题吗?你是怎么解决的?

这是我的控制台输出的转储(为了可读性进行了压缩)

Started by an SCM change
Building in workspace 
Fetching changes from the remote Git repository
Fetching upstream changes from repo
Seen branch in repository origin/HEAD
Seen branch in repository origin/master
Seen branch in repository origin/pr/1/head
Seen branch in repository origin/pr/1/merge
Seen branch in repository origin/pr/10/head
[…]
Seen branch in repository origin/pr/9/head
Seen branch in repository origin/pr/9/merge
Seen 33 remote branches
Checking out Revision 9b4d45ee3a2d265a1268c2931e7b2bcb738e1c87 (origin/pr/16/merge)
First time build. Skipping changelog.
...found 160 targets...
...updating 21 targets...
**passed** test/bin/test.test/gcc-4.8.1/debug/test.test
[xUnit] [INFO] - Starting to record.
[xUnit] [INFO] - Processing BoostTest-1.x (default)
[xUnit] [INFO] - Check 'Failed Tests' threshold.
[xUnit] [INFO] - Check 'Skipped Tests' threshold.
[xUnit] [INFO] - Setting the build status to SUCCESS
[xUnit] [INFO] - Stopping recording.
Finished: SUCCESS

最佳答案

在查看 Jenkins LOGS 后,我学到了一些东西:

  • 这个插件(github pull-request builder)完全取代了所有其他的构建触发器(包括 git 和 SCM poll)。我使用了所有三个,当我认为这个插件工作是因为它正确构建时,实际上是其他触发器。
  • 必须在 github 插件上设置您的项目 github URL。这个插件依赖于 github 插件来工作。这就是阻止它在我的配置中工作的原因。

  • 修复 #2 后,您可以从 SCM Poll 和 Git 中删除触发器,以确保 pull-request 插件正在触发构建。当它这样做时,它实际上将拉取请求的链接添加到 Jenkins 中的事件提要(非常好)并正确更新 github 上的状态。

    关于github - Jenkins github 拉取请求构建器插件未发布到 github,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20137528/

    相关文章:

    Github + 部署 key ...

    git - 当子模块是私有(private) Github repos 时 git 子模块的问题

    Xcode 7 : changing product bundle identifier

    jenkins - 更改 Jenkins 报告的颜色

    jenkins - 将变量从 shell 脚本传递到 jenkins

    jenkins - 避免使用大型日志 Jenkins 文件(并在需要时停止构建)

    Github for mac diff 选项

    github - 克隆时git连接超时

    jenkins - Jenkins 作业的日历 View

    android - Gradle build for Android 中的 JUnit 测试结果在哪里?