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

The Nexus Suite is uniquely architected for a DevOps native world and creates value early in the development pipeline, provides precise contextual controls at every phase, and accelerates DevOps innovation with automation you can trust. Read how in this ebook.

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?

The DevOps Zone is brought to you in partnership with Sonatype Nexus.  See how the Nexus platform infuses precise open source component intelligence into the DevOps pipeline early, everywhere, and at scale. Read how in this ebook

Topics:
jenkins ,plugin ,devops ,github

Published at DZone with permission of Guy Salton, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}