本文介绍了Jenkins 流水线作业未在 GitHub 推送上触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了 Jenkins Pipline 作业并希望在我的 GitHub 存储库推送事件中触发它.

I've created Jenkins Pipline job and want it to be triggered on my GitHub repo push event.

我已将 repo url 添加到作业配置并检查了触发推送选项":

I've added repo url to job config and checked "trigger on push option":

我还添加了具有 jenkins 配置 Github 部分所需权限的 GitHub 令牌:

I've also added GitHub token with needed rights to jenkins configure Github section:

在 Github 存储库中,我为我的 Jenkins 服务器启用了 webhook:

In Github repo I've enabled webhook for my Jenkins server:

在推送到我的 GitHub 存储库后,所有步骤仍然没有触发.

And after all steps still nothing is triggered after push to my GitHub repo.

有谁知道发生了什么以及为什么 Jenkins 不触发配置的管道作业?

Does anyone have any idea what's going on and why Jenkins doesn't trigger configured pipeline job?

推荐答案

OP在评论中提到的解决方案是正确的.

Solution mentioned by OP in a comment is correct.

假设您的 Jenkins 的 Github webhook 设置正确且可访问(可以在 Github UI 中验证),您需要手动启动一次构建.构建完成后,存储库中的更改将自动启动新的构建.

Assuming you have a Github webhook for your Jenkins set up correctly and accessible (can be verified in the Github UI), you need to start the build manually once. Upon completion of the build, changes in the repository will automatically start new builds.

来自 user8888 的注释:

您实际上需要手动启动构建并且构建必须成功.失败的构建不会做任何事情.

这篇关于Jenkins 流水线作业未在 GitHub 推送上触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-30 14:15