How to add GitHub support to Jenkins

0
5

Add your GitHub repository to the powerful Jenkins automation platform.

How to add GitHub support to Jenkins
Add your GitHub repository to the powerful Jenkins automation platform.

Automation is the name of the game for business, especially in this cloud-centric, containerized world we now live in. To that end, you might have installed Jenkins as your open source, automation server. With that tool ready to serve, you’re probably wondering how to make it more useful. 

The first thing you should do is add GitHub support. With GitHub supported included, you can empower Jenkins with your Git repositories, such that it will automatically work with that centralized location containing your code.

But how do you add GitHub support to Jenkins? It’s actually quite simple. Let me show you.

SEE: Hybrid cloud: A guide for IT pros (TechRepublic download)

Additional resources

What you’ll need

The only things you’ll need to make this work are:

  • A running instance of Jenkins.
  • An admin account to log into your Jenkins server.
  • A GitHub account.

That’s it. Let’s make the connection.

How to install the plugin

Log into your Jenkins server with an admin account. From the main page, click Manage Jenkins (Figure A).

Figure A

jenkinsgita.jpg

In the resulting page (Figure B), click Manage Plugins. 

Figure B

jenkinsgitb.jpg

Managing your Jenkins server.

In the resulting window, click Check Now. After a moment, you should be able to search for Git in the search field. Once the results appear (Figure C), click the checkbox for GitHub Authentication.

Figure C

jenkinsgitc.jpg

The GitHub Authentication plugin.

Once you’ve marked the plugin for installation, you’ll see the Download Now And Install After Restart button. Click that and wait for the installation and restart to complete. If the Jenkins page doesn’t refresh after a while, simple go back to http://SERVER_IP:8080 (where SERVER_IP is the IP address of the server) and log back in.

How to connect with GitHub

Go back to the main Jenkins page and click Create Job. You should now see a listing of possible jobs (Figure D). Type a name for the new job, select Freestyle Project, and click OK.

Figure D

jenkinsgitd.jpg

In the Source Code Management tab (Figure E), select Git and then fill out the necessary repository URL for your GitHub project repository.

Figure E

jenkinsgite.jpg

Configuring GitHub authentication.

Click the Add drop-down associated with Credentials, select Jenkins, and then fill out the required bits of information (Figure F).

Figure F

jenkinsgitf.jpg

Adding authentication credentials for GitHub.

And that’s it. You can now start working with your project through Jenkins, creating build triggers, adding post-build actions, and much more. Congratulations, you’re one step closer to adding automation to your project.

Also see

jenkinshero.jpg

Image: GitHub

Source link

LĂSAȚI UN MESAJ

Please enter your comment!
Please enter your name here