Automate Building CI/CD pipelines with Jenkins and GitHub

Automate Building CI/CD pipelines with Jenkins and GitHub

July 17, 2020 / Nirav Shah


TABLE OF CONTENTS


Automate Building CI/CD pipelines with Jenkins and GitHub


Steps To Setting Up CI/CD Pipelines with Jenkins and GitHub


Step 1:Login to your Jenkins account


Step 2:Click on “manage jenkins”


Step 3:Put the description


Step 4:Keep Source Code Management


Step 5:In Build option


Step 6:Click on the job name


Step 7:configure


Step 8:Git account and Clone


Step 9:Source Code Management


Step 10:Write commands

Jenkins with Github is used to create CI and CD pipeline. So that we can automate the Build and Deployment process using Jenkins Jobs.
Don’t know about Jenkins? Go through this article to know, how you can install java and jenkins on AWS.

Steps To Setting Up CI/CD Pipelines with Jenkins and GitHub

 

Step 1

Login to your Jenkins account

Jenkins account login page

 

Step 2

Click on “manage jenkins”

Jenkins dashboard manage jenkins

 

And go to the “managed plugins”

Manage plugins in jenkins

 

So you can see all the required GIT plugins will install. It will take some time

GIT plugins install in jenkins plugins

 

Now to click on “create a new job” or new item and go to freestyle project

Jenkins dashboard create a new jobs

Add project name details in jenkins job creation process

 

 

Step 3

Put the description about the Jenkins job you are creating.keep the value of Max # of builds to keep as 5

Add description about the Jenkins job

 

Step 4

Keep Source Code Management as none. As we are not using any Source Code right now.

Keep Source Code Management as none

 

Click on checkbox Build periodically. Put 5 stars with space like * * * * * in the schedule box and this means your job will run on every minute. This is called crontab.

Build triggers and adddetails jenkins job

 

Step 5

In Build option, Execute Shell.

Jenkins build environment select Execute Shell

 

 

Some basic command that I put here are

Pwd 
W
Free -m

Add execute shell command code

Step 6

Now your First Jenkins Build job is created. Click on the job name “New Project” to see your builds

 First Jenkins Build job is created

 

After your build is created you will see “console output” it is very important for troubleshooting purposes.

Jenkins project console output

 

Step 7

Click on configure

Configure new create dproject jenkins

 

Step 8

Now go to your git account and Clone or Download and copy the repository URL.

Step 9

Source Code Management and click on Git. Paste the copied URL of Git Repository

Source Code Management and click on Git

 

Step 10

Now scroll down to build and write below commands

git pull origin master 
git status
Pwd
ls -lrt

Jenkins new project build enter commands

And click on save, Now Click on Build Now and then Click on Build No #7300

Click Build Now and then Click on Build No

 

And final step click on console output and its look like this

Console output jenkins

 

Congratulations! You have an automated CI/CD pipeline with Jenkins and GitHub.

Also Read: Integration of jenkins with gitlab

Talk to AWS Certified Consultant

    Spread Love By Sharing:

    Let’s Talk About Your Needed AWS Infrastructure Management Services

    Have queries about your project idea or concept? Please drop in your project details to discuss with our AWS Global Cloud Infrastructure service specialists and consultants.

    • Swift Hiring and Onboarding
    • Experienced and Trained AWS Team
    • Quality Consulting and Programming
    Let’s Connect and Discuss Your Project