Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

How to Start Working with the GitHub Plugin for Jenkins

DZone's Guide to

How to Start Working with the GitHub Plugin for Jenkins

This plugin will both help save you time and let you incorporate your project into the Continuous Integration (CI) process.

· DevOps Zone ·
Free Resource

Discover how quick and easy it is to secure secrets, so you can get back to doing what you love. Try Conjur, a free open source security service for developers.

The GitHub plugin for Jenkins is the most basic plugin for integrating Jenkins with GitHub projects. If you are a GitHub user, this plugin enables you to schedule your build, pull your code and data files from your GitHub repository to your Jenkins machine, and automatically trigger each build on the Jenkins server after each Commit on your Git repository.

This saves you time and lets you incorporate your project into the Continuous Integration (CI) process.

How to Start Working with the GitHub Plugin for Jenkins

Before you begin, Install the Github Jenkins plugin and configure it. Then...

1. Go to Manage Jenkins > Configure System.

Jenkins - Configure System

1a. In the GitHub section, choose Add Github Server.

Github Server - Jenkins

1b. Add credentials (your GitHub token) and click Save.

Jenkins Credentials

Jenkins Configuration

2. Open your Jenkins Project.

2a. Check the GitHub project checkbox and set the Project URL to point to your GitHub Repository.

Github Project - Jenkins Continuous Integration

2b. Under Source Code Management, check Git and set the Repository URL to point to your GitHub Repository.

Github Source Code

2c. Under Build Triggers, check the Build when a change is pushed to GitHub checkbox. 

Github Triggers


3. Install the Jenkins (GitHub plugin) and set a webhook to your Jenkins machine.

3a. From your GitHub repository, go to Settings > Integrations & Services.

3b. Click on Add Service > add Jenkins (GitHub plugin).

Taurus - Automated Testing

Taurus Continuous Testing

3c. Set the Jenkins hook URL as the URL for your Jenkins machine, and add /github-webhook/.

Jenkins Continuous Testing

Congratulations! Every time you publish your changes to GitHub, GitHub will trigger your new Jenkins job.

Once the GitHub plugin is fully installed and integrated into your Jenkins project, you have completed a very crucial step towards the full CI process. Now, you can proceed to the testing phase. To complete the full CI process, integrate your load testing into your CI tool. For more details about how to do this with Taurus, an open source automation tool, see here.

You might also find these useful:

Automated Performance Tests in Jenkins CI Environments

What is “Continuous Testing” and How is it Even Possible?

Conjur is a free open source security service built by DevOps engineers. With integrations with all your favorite tools and an easy way to secure secrets, it's a no brainer. Come check it out!

Topics:
jenkins ,plugin ,devops ,github

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}