运行 Jenkins 作业 Github 推送

Run Jenkins job on Github Push

我知道这个问题已经被问过好几次了,我也看了很多答案,其中 none 仍然对我有用。

我正在关注 Setting up a github webhook in jenkins 并尝试 运行 Jenkins 工作建立在 Github 推送上。

但是在Services / Manage Jenkins (GitHub plugin)中添加Jenkins hook url后,标记为Active 然后在 Update Service 当我点击 Test service 按钮时,我总是收到消息:

Okay, the test payload is on its way.

我也尝试在 Github 存储库中推送更改,但工作没有 运行,然后我回到服务部分,然后有一个红色警告符号和消息 "Last delivery was not successful. Service Timeout"

你能帮我解决这个问题吗?

如有任何帮助,我们将不胜感激。谢谢。

因为我的 Jenkins 配置为 localhost,所以在 Jenkins hook url 中引用 http://127.0.0.1:9999/github-webhook/ 将不起作用因为 Github 服务器将无法连接到 Jenkins 服务器来触发构建。可以从这里阅读更多内容: