top of page
ritikasrigkp

Jenkins Basics and Installation

Jenkins is an open source continuous integration (CI) server. It manages and controls several stages of the software delivery process, including build, documentation, automated testing, packaging, and static code analysis. Jenkins is a highly popular DevOps tool used by thousands of development teams.


What Is Jenkins Used For?

Jenkins software’s popularity stems from its ability to track and monitor repetitive activities that emerge throughout a project’s development. For example, if your team is working on a project, Jenkins will continually test your builds and alert you to any mistakes early in the process. Its top use cases include:

1. Deploying code into production

If all of the tests developed for a feature or release branch are green, Jenkins or another CI system may automatically publish code to staging or production. This is often referred to as continuous deployment. Changes are done before a merging action can also be seen. One may do this in a dynamic staging environment. Then it’s distributed to a central staging system, a pre-production system, or even a production environment when combined.

2. Enabling task automation

Another instance in which one may use Jenkins is to automate workflows and tasks. If a developer is working on several environments, they will need to install or upgrade an item on each of them. If the installation or update requires more than 100 steps to complete, it will be error-prone to do it manually. Instead, you can write down all the steps needed to complete the activity in Jenkins. It will take less time, and you can complete the installation or update without difficulty. 

3. Reducing the time it takes to review a code

Jenkins is a CI system that may communicate with other DevOps tools and notify users when a merge request is ready to merge. This is typically the case when all tests have been passed and all other conditions have been satisfied. Furthermore, the merging request may indicate the difference in code coverage. Jenkins cuts the time it takes to examine a merge request in half. The number of lines of code in a component and how many of them are executed determines code coverage. Jenkins supports a transparent development process among team members by reducing the time it takes to review a code.

4. Driving continuous integration

Before a change to the software can be released, it must go through a series of complex processes. The Jenkins pipeline enables the interconnection of many events and tasks in a sequence to drive continuous integration. It has a collection of plugins that make integrating and implementing continuous integration and delivery pipelines a breeze. A Jenkins pipeline’s main feature is that each assignment or job relies on another task or job.

On the other hand, continuous delivery pipelines have different states: test, build, release, deploy, and so on. These states are inextricably linked to one another. A CD pipeline is a series of events that allow certain states to function. 

5. Increasing code coverage

Jenkins and other CI servers may verify code to increase test coverage. Code coverage improves as a result of tests. This encourages team members to be open and accountable. The results of the tests are presented on the build pipeline, ensuring that team members adhere to the guidelines. Like code review, comprehensive code coverage guarantees that testing is a transparent process for all team members. 

6. Enhancing coding efficiency 

Jenkins dramatically improves the efficiency of the development process. For example, a command prompt code may be converted into a GUI button click using Jenkins. One may accomplish this by encapsulating the script in a Jenkins task. One may parameterize Jenkins tasks to allow for customization or user input. Hundreds of lines of code can be saved as a result.

Further, it supports manual testing where necessary without switching environments. When code is hosted locally, it does not always work well when pushed to a central system on a private or public cloud. This occurs because things change by the time they push. Continuous integration on Jenkins allows for manual testing that compares code to the current state of a code base in a production-like environment.

7. Simplifying audits

When Jenkins tasks run, they collect console output from stdout and stderr parameters. This makes troubleshooting using Jenkins extremely straightforward. You may assess run timing and find the slowest step utilizing the time stamper plugin, allowing you to tweak the performance of each operation. 

8. Using Slack for synchronization

A major Jenkins use case is its compatibility with Slack. A centralized communication platform is a must-have for large teams, and one of the most popular platforms for this purpose is Slack. Jenkins may be integrated with Slack, allowing communication such as triggered activities, their times, users’ names, and outcomes to be shared with others.


Prerequisites for Jenkins:-


1:System with prefered Operating System(Windows,MacOs or Linux)

2:JDK (Java Development Kit)



Beginning with the Jenkins 2.463 weekly release (scheduled for release on June 18, 2024), Jenkins requires Java 17 or newer. The Jenkins 2.452.x LTS line will continue to require Java 11 or newer, as will the LTS line (possibly 2.462.1) that is scheduled for release on July 24, 2024, whose baseline will be 2.462 (the last weekly release to support Java 11) or earlier. The first LTS release to require Java 17 or newer will ship at the end of October 2024.


Now,to check your Java Version(Windows) -

Open Command Prompt and type Java -version



For Mac OS we can go to terminal and type same command to get the current version on your system.

or else we can download it from Oracle.com


Now if you already have Java installed then check Java and Jenkins compatibility.


For that go to google and search for Jenkins Java compatibility and then get the required version



Also in case of multiple Java version we can select reqired Java version by setting the environment variable path in your system.

Settings-->Advance system setting -->Environment Variables--> Java_Home (if not create a folder with Java home and give the java path until bin folder) -->Click on Path and give the java Path and click OK



Jenkins Download and Install

1: Go to Jenkins download and download the Jenkins war file



2:To Access Jenkins go to cmd or terminal and goto the jenkins.war file in your machine

Run command java -jar jenkins.war(this is for default port 8080)

To run jenkins on different port use command java -jar jenkins.war --httpPort=9191



In above screenshot we can see the line Jenkins is fully up and running.

Now go to browser and type http://localhost:9191


Put the password from command prompt or from below highlighted location on your system


Now on Getting started page select pre installed plug-in or select plug -in according to your requirement.

After Installation create a login to for first admin User

After creating username we will get below page

Click on Start using Jenkins and we will get the Jenkins dashboard page




Create A new Job

Create a new job or click on new Item

Enter the name for your Job (any meaningful name) and select Freestyle project

After Creating a new Project we will give our job configurations such as Build steps,Triggers etc.





And Run the Job.


Now to Stop Jenkins goto command prompt and close the tab or press ctrl+C Jenkins will be stopped.


Jenkins jobs can be configured using a graphical interface or by defining pipelines as code using Jenkins file, a domain-specific language designed for describing CI/CD workflows.


Thank you!!

Keep Learning!!

27 views

Recent Posts

See All
bottom of page