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

Enabling Transformation in Hospitality through Technology-Led Innovation

As the exclusive sponsor of the 2024 Hotel Visionary Awards, we support organizations leading ...

Read More

Key Insights from HLTH 2024: The Future of Patient-Centered Healthcare

Discover key insights from HLTH 2024 on digital health, AI in diagnostics, data interoperability, ...

Read More

Data-Driven Engineering: Transforming Operations and Products from Insight to Impact

Discover how data-driven engineering transforms operations and product development, enhancing team ...

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