One of the basic steps of implementing CI/CD is integrating your SCM (Source Control Management) tool with your CI tool. This saves you time and keeps your project updated all the time. One of the most popular and valuable SCM tools is GitHub. In this blog I will explain how to integrate Jenkins with GitHub projects.
The integration presented in this blog post will teach you to:
- Schedule your build
- Pull your code and data files from your GitHub repository to your Jenkins machine
- Automatically trigger each build on the Jenkins server, after each Commit on your Git repository
But first, let’s configure the GitHUb and Jenkins integration. Let's begin with the GitHub side!
Configuring GitHub
Step 1: go to your GitHub repository and click on ‘Settings’.
We're done with the configuration on GitHub’s side! Now let's move on to Jenkins.
That's it! Your GitHub repository is integrated with your Jenkins project. You can now use any of the files found in the GitHub repository and trigger the Jenkins job to run with every code commit.
For example, I will show you how to run a Selenium Test script that I uploaded to GitHub repository from my Jenkins project.
Triggering the Jenkins Job to Run with Every Code Commit
Step 10: Click on the ‘Build’ tab, then click on ‘Add build step’ and choose ‘Top Level Maven Targets.
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.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.