First CI/CD pipeline with Jenkins and Github

Himavarsha Madala
4 min readSep 24, 2021

Guide to create and deploy a freestyle Jenkins project

how are we going to automate? Enter the paradigm of Dev Ops, Dev Ops focuses on making the cycles of development and operations compatible with each other, it tries to bind them both together. Jenkins is a CI/CD Dev Ops tool built in Java.

Understanding Jenkins…

Jenkins can be viewed as just another tool in DevOps. Written in Java, this is open-source software. Being available free of cost is one of the most critical factors for the immense popularity of Jenkins DevOps. It is easy to install and configure in one’s system, which is a bonus. Jenkins is highly flexible, and one can add multiple plugins to it. That way, the functionality of Jenkins can be altered to suit the individual needs of the project in hand.

to understand Jenkins in detail…

Jenkins Master and Slave Concept

A Jenkins master comes with the basic installation of Jenkins, and in this configuration, the master handles all the tasks for your build system. If you are working on multiple projects, you may run multiple jobs on each project. Some projects need to run on some nodes, and in this process, we need to configure slaves. Jenkins slaves connect to the Jenkins master using the Java Network Launch Protocol.

prerequisites to run Jenkins in your system

Incase if you don't have Jenkins in your system you need to install it, so go through septs below and install them in your system.

firstly when you need Jenkins in your system you need to provide JDK OR JRE while installing Jenkins. Also Jenkins accepts only java version 8 or 11.

Now I'm going to provide java version 11,

Do select according to your system (Java Platform, Standard Edition 11 Reference Implementations )

select this for downloading Jenkins in here -> Get started

Source to download Jenkins :

How to Download & Install Jenkins on Windows (guru99.com)

After this process is completed you will log into your Jenkins profile.

you can access you page by giving your local host address

localhost:8081
Main Jenkins page

By default you will see your master node

Dashboard -> Manage Jenkins -> Manage Nodes and Clouds

create slave node:

click on New Node

In this process I gave my slave to connecting to mater node and I have created my own workspace for slave-1 and I gave path of my file in remote root directory

Click save

after this setup you will see your slave 1 as

here, I'm going to run my agent in command line.

and dont forget to download agent.jar file. You need to copy agent.jar in new file and give that path as follow…

If your cmd shows this output your slave is successfully created

create job in freestyle:

Dashboard -> New Item -> Freestyle Project

In this Job we are going to provide slave 1 in label expression

here we need to give code repo and credentials of git in add section

since I have no branch in my repo …

here in build we need to select execute windows batch command

I provided my file in command as python first.py

after build your project check your project in console output and your first project is successfully created

--

--