首页 文章

如何使用github webhook触发Multibranch Pipeline构建

提问于
浏览
9

在自由式作业中,在舞台构建触发器上有一个名为“GITScm轮询的GitHub钩子触发器”的选项 .

屏幕截图:

screen capture here
.

与gitlab配置中的webhook一起“http://myjenkins/gitlab/notify_commit " it works fine, meaning that the build will be triggered automatically when something is pushed to the repository. But why in Multibranch Pipeline there is only one option named "如果没有其他运行则定期”?有没有安装插件?如何使用像自由式作业的github webhook触发Multibranch Pipeline构建

1 回答

  • 9

    This页面描述了如何在jenkins的multibranch工作流上配置pipeline-as-code .

    这是里面描述的引用:

    Workflow Multibranch功能(由工作流插件提供)提供以下关键功能:在repo中每个新分支在Jenkins中创建自动工作流(作业)(假设webhooks从GH注册到Jenkins) . 特定于该子分支及其独特的scm更改和构建历史 . 根据设置从存储库中删除分支的自动作业修剪/删除 . 通过覆盖父属性(如果需要),可以灵活地单独配置分支属性 .

    要配置webhook,请参阅this页面 .

    要检查事件是否通知您的jenkins,您可以使用以下此功能:
    enter image description here

    PS:观察您配置的URL目标,如果您错过了网址末尾的"/",则可能无法访问jenkins .

    我希望这有帮助!

相关问题