21

In freestyle job there is an option named "GitHub hook trigger for GITScm polling" on stage Build Trigger.

screen capture here:

screen capture here.

Together with webhook in gitlab config "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 "Periodically if not otherwise run"? Is there some plug-in not installed? How to trigger Multibranch Pipeline build with github webhook like freestyle job

1 Answer 1

21

This page described how to configure pipeline-as-code on multibranch workflow in jenkins.

This is the quote from the description inside:

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.

To configure the webhooks, refer to this page.

To check if the events notify your jenkins you can use this feature below: enter image description here

PS: Watch the URL target that you configured, if you miss the "/" at the end of url it might not be able to reach the jenkins.

I hope this helps!

3
  • 2
    Adding web hook doesnt helps when multi branch pipeline is configured to use GIT ( with credentials).
    – TechFree
    Dec 10, 2020 at 16:13
  • 1
    @TechFree So, is it not possible to trigger web-hook from Bitbucket Cloud to Jenkins if we have configured GIT as source provider? Is there any way to trigger webhook using GIT as provider instead of Bitbucket or Github? Sep 3, 2021 at 11:31
  • The Workflow Multibranch plugin is archvied now
    – Sergei
    May 23 at 11:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.