How to Use GitHub Plugin for Jenkins?
In order to integrate Jenkins with GitHub, all you require is a plugin. The GitHub plugin for Jenkins allows you to schedule your build and facilitates easy transfer of data from the GitHub repository to Jenkins machine. Moreover, it also triggers each build automatically after each commit.
This not only saves time, but also allows you to incorporate your project in the CI (Continuous Integration) process.
Get Started with GitHub Plugin for Jenkins
- Install the GitHub Jenkins plugin.
- Configure the plugin:
b) Add GitHub Server by going to the GitHub Section.
c) Add the credentials and click Save.
- Open your Jenkins Project:
c) Go to ‘Build Triggers’ and ensure ‘Build when a change is pushed to GitHub’ is checked.
4. Set a webhook to your Jenkins after installing the Jenkins plugin.
a) Go to GitHub repository->Settings->Integrations & Services.
b) Add ‘Jenkins (GitHub plugin) from Add Service.
c) Set the URL of your Jenkins machine as Jenkins Hook URL. Add /github-webhook/
You may also like: How to Build Maven with Jenkins?