Table of Contents

Here’s how making a commit to your selected Github branch can trigger a Jenkins build and how to set it up in your Jenkins server.
To start, you need to make sure your Jenkins installation is available to the internet or else it won’t work.

How Does It Work?

Jenkins uses a webhook. A webhook (or web callback) is a way for an app to provide other applications with real-time information. Meaning that GitHub will send a webhook to our Jenkins server. Our Jenkins application will build and test the changes and send the build status for the commit that was made.

GitHub Integration Plugin

You need to install a special plugin for Jenkins called “GitHub Integration”.

Follow these steps,

  1. Go to Manage Jenkins > Manage Plugins > Available.
  2. Use the search bar and search for “GitHub”.
  3. Search and select the plugin named “GitHub Integration”.
  4. Click on “Download now and Install after Restart”.

Setup

Follow these steps to create a job (if you haven’t already),
Check the “Github project” checkbox and place your Github repository URL link.

1 – Check the “Github project” checkbox and place your Github repository URL link.

2 – Under the Source Code Management section we select “git” and place our repository URL once again.

3 – Specify which branches you want to build. By default Jenkins will select the master branch for you.

4 – Now you can select your build triggers. The Github Integration plugin will add the “Github hook trigger for GITScm polling” option for you. Which means that every time Jenkins receives a PUSH GitHub hook (from the repository you defined in the Source Code Management section) it will trigger the polling login you previously defined.

After all that, just let GitHub know that it has to notify your Jenkins server every time there is a commit.To do this, go to GitHub repository > settings > Webhooks > Add webhook

Then fill the following information,

1 – In Payload URL place the Jenkins server URL with this format: “<PAYLOAD_URL>/github-webhook/”. Just by appending this “/github-webhook/” you are telling Jenkins to route the request to the GitHub plugin.

2 – Select the content type.

3 – Configure when GitHub should send events to this webhook.

4 – Check the “Active” box.

And you are done! Your Jenkins server will build according to how you configured the GitHub webhook. Any questions or comments send me a line at jcordoba@nearsoft.com.

Learn More about Encora

We are the software development company fiercely committed and uniquely equipped to enable companies to do what they can’t do now.

Learn More

Global Delivery

READ MORE

Careers

READ MORE

Industries

READ MORE

Related Insights

Online Travel Agencies: Some Solutions to changes in booking and commission attributions

Discover how we can simplify travel changes for both travelers and OTAs using blockchain and ...

Read More

The AI-Powered Journey: How AI is Changing the Face of Travel

As travel elevates itself into an experience where every journey is as unique as the travelers ...

Read More

Enhancing Operational Excellence with AI: A Game-Changer for the Hospitality Industry

By AI, the hospitality industry can offer the best of both worlds: the efficiency and ...

Read More
Previous Previous
Next

Accelerate Your Path
to Market Leadership 

Encora logo

Santa Clara, CA

+1 669-236-2674

letstalk@encora.com

Innovation Acceleration

Speak With an Expert

Encora logo

Santa Clara, CA

+1 (480) 991 3635

letstalk@encora.com

Innovation Acceleration