Triggering Jenkins Multibranch Pipeline by raising a Pull Request in GitHub

56 views
Skip to first unread message

Sunil Boga

unread,
Nov 28, 2017, 9:02:49 AM11/28/17
to Jenkins Users
I am using Jenkins Multibranch pipeline.
I've configured the APIs (github-webhook and ghprbhook) on GitHub.
Currently, If I click on "Scan Repository Now/Scan Repository Log" in Jenkins, the Jenkins will go through the GitHub and creates a new PR job in Jenkins if there are any PR on GitHub.
So I need to trigger this Multibranch pipeline whenever there is a Pull Request raised on GitHub. I want this pipeline to trigger automatically when there is a PR on GitHub.
What do I need to do to achieve this approach?
Is it possible to trigger Multibranch pipeline automatically whenever a PR is raised on GitHub?

Ramanathan Muthaiah

unread,
Nov 29, 2017, 8:27:37 AM11/29/17
to Jenkins Users
So I need to trigger this Multibranch pipeline whenever there is a Pull Request raised on GitHub. I want this pipeline to trigger automatically when there is a PR on GitHub.
What do I need to do to achieve this approach?
Is it possible to trigger Multibranch pipeline automatically whenever a PR is raised on GitHub?

Yes, configure webhook in GH repository to send event related to Pull Request, if that's sufficient for your requirement. Select all the events (don't remember the exact name) if you have need for all the events to be passed to jenkins master.

NOTE:
Jenkinsfile may or may not need the property (related to github push) to be set. There were few threads in this group on this setting.

/Ram

Stephen Connolly

unread,
Nov 29, 2017, 2:29:31 PM11/29/17
to jenkins...@googlegroups.com
If multibranch *do _not_ set* as multibranch is opinionated and will respond to the events itself... setting the property may result in double builds or other strange behaviour

/Ram

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/b99e6c4e-da0b-4582-a1b3-7534d6f84f93%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Sent from my phone
Reply all
Reply to author
Forward
0 new messages