在自由式作业中,舞台 Build Trigger 上有一个名为“GitHub hook trigger for GITScm polling”的选项。
屏幕截图在这里:
.
与 gitlab 配置“http://myjenkins/gitlab/notify_commit”中的 webhook 一起工作正常,这意味着当将某些内容推送到存储库时,将自动触发构建。
但是为什么在 Multibranch Pipeline 中只有一个名为“Periodically if not else run”的选项?是不是有些插件没有安装?如何像自由式作业一样使用 github webhook 触发多分支管道构建
最佳答案
This页面描述了如何在 Jenkins 的多分支工作流上配置管道即代码。
这是里面描述的引述:
The Workflow Multibranch feature (provided by the workflow plugin) provides the following key abilities:
- Automatic Workflow (job) creation in Jenkins per new branch in the repo (assuming webhooks are registered from GH to Jenkins).
- Build specific to that child-branch and its unique scm change and build history.
- Automatic job pruning/deletion for branches deleted from the repository, according to the settings.
- Flexibility to individually configure branch properties, by overriding the parent properties, if required.
要配置 webhook,请参阅 this页。
要检查事件是否通知您的 Jenkins ,您可以使用以下功能:
PS:注意你配置的 URL 目标,如果你错过了 url 末尾的“/”,它可能无法访问 jenkins。
我希望这有帮助!
关于jenkins - 如何使用 github webhook 触发多分支管道构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43314483/