【发布时间】:2017-05-26 21:59:19
【问题描述】:
Jenkins 2.32.1,所有插件今天更新到最新版本。我在使用较旧版本的插件时遇到了这个问题,所以我认为这不仅仅是最近的插件错误。
当我在 Jenkins UI 中要求时,我的项目构建良好。当我将其配置为轮询时,它也可以正常构建。但是,我无法通过推送到 Github 来触发构建。
在我的项目配置中,
- “Github 项目”被选中,并在其下方输入 URL (https://github.com/myorg/myrepo/)
- 选中“将更改推送到 GitHub 时构建”
- 然后是
在 Github 方面,我有
Webhook 交付成功,即返回 HTTP 状态 200。
在https://jenkins.myorg.com/job/api/GitHubPollLog/ 我明白了
Last GitHub Push
Started on Jan 11, 2017 10:33:41 PM
Using strategy: Default
[poll] Last Built Revision: Revision ee4b3fe5b57ecd5ae5875bce573b32bb60074dfa (refs/remotes/origin/master)
using GIT_SSH to set credentials
> git ls-remote -h git@github.com:myorg/myrepo.git # timeout=10
Found 2 remote heads on git@github.com:myorg/myrepo.git
Using strategy: Default
[poll] Last Built Revision: Revision ee4b3fe5b57ecd5ae5875bce573b32bb60074dfa (refs/remotes/origin/master)
using GIT_SSH to set credentials
> git ls-remote -h git@github.com:myorg/myrepo.git # timeout=10
Found 2 remote heads on git@github.com:myorg/myrepo.git
Done. Took 2 sec
No changes
“最后构建的修订版”行确实说明了最近(手动)构建的修订版的 SHA。但是有一些变化,因为我只是为了测试目的推送了一个虚假更新。
在 Jenkins 的主日志中我看到了
Jan 11, 2017 10:33:41 PM INFO
org.jenkinsci.plugins.github.webhook.subscriber.DefaultPushGHEventSubscriber onEvent
Received POST for https://github.com/myorg/myrepo
Jan 11, 2017 10:33:41 PM INFO
org.jenkinsci.plugins.github.webhook.subscriber.DefaultPushGHEventSubscriber$1 run
Poked api
仅此而已。
我知道类似的问题已经被问过很多次了。我已经检查了
中提到的所有注意事项- Jenkins-Build when a change is pushed to GitHub option is not working
- How to trigger a Jenkins build when a push is made to a private github repository
没有成功并阅读了许多其他内容而没有获得任何其他见解。有什么建议吗?
【问题讨论】: