All about Jenkins and its use cases

Vibhanshusharma
6 min readMar 13, 2021

--

Jenkins-

Jenkins is an open-source server that is written entirely in Java. It lets you execute a series of actions to achieve the continuous integration process, that too in an automated fashion.

This CI server runs in servlet containers such as Apache Tomcat. Jenkins facilitates continuous integration and continuous delivery in software projects by automating parts related to build, test, and deployment. This makes it easy for developers to continuously work on the betterment of the product by integrating changes to the project.

Jenkins automates the software builds in a continuous manner and lets the developers know about the errors at an early stage. A strong Jenkins community is one of the prime reasons for its popularity. Jenkins is not only extensible but also has a thriving plugin ecosystem.

Some of the possible steps that can be performed using Jenkins are:-

  • Software build using build systems such as Gradle, Maven, and more.
  • Automation testing using test frameworks such as Nose2, PyTest, Robot, Selenium, and more.
  • Execute test scripts (using Windows terminal, Linux shell, etc.
  • Achieve test results and perform post actions such as printing test reports, and more.
  • Execute test scenarios against different input combinations for obtaining improved test coverage.
  • Continuous Integration (CI) where the artifacts are automatically created and tested. This aids in the identification of issues in the product at an early stage of development.

What is Continuous Integration?

In an Agile world, agile developers began to embrace and promote test-driven development and continuous integration (CI). With these techniques we could automatically build source code whenever a developer checked it into a source repository, executing an exhaustive unit test suite to ensure that an application was working properly. Many test-driven developers also started doing integration testing and performance testing in a secondary CI process.

With continuous integration, we could detect errors more quickly and release code much faster than we had done in previous years. It’s no exaggeration to say that CI tamed the “build” side of the build-and-deploy cycle. These days many dev teams have moved beyond CI to CD, which stands for either continuous delivery or continuous deployment. Whatever the designation, the CD is a process that moves software from code check-in to staging, or even production deployments.

What is Jenkins Pipeline?

A Jenkins pipeline is a combination of jobs, tasks, or events that are connected to each other in a sequence. In other words, it is a group of plugins that enable continuous delivery pipelines to be easily integrated and implemented. Extendable automation works to support a pipeline in the creation of both complex and simple delivery pipelines in the form of code and with the help of domain-specific language or DSL.

Let us now discuss a little about continuous delivery pipelines and how they work. The basic characteristic of a Jenkins pipeline is that each event or task or job that it holds is dependent in one way or the other on one or more of these events, jobs, or tasks. Continuous delivery pipelines feature different states, such as build, test, deploy, release. All these states are connected to each other.

A continuous delivery pipeline is a sequence that events of each of these states work in. It is an automated expression that processes required for getting version control software. All the changes that are made to the software have to pass through several complex processes before the software is released. This process also ensures that the software is developed in a repeatable and reliable way and involves multiple testing and deployment stages, which the software progresses through.

Master- Agent Architecture In Jenkins.

The master-agent (or distributed) architecture in Jenkins is used for managing distributed builds. The Master and Agent(s) communicate through the TCP/IP protocol. These are the roles and responsibilities of the Jenkins Master and Agent(s):

Jenkins Master

The main server in Jenkins is the Master. Here are the jobs handled by Jenkins Master:

  • Schedule build jobs
  • Choosing the appropriate agent in the master-agent ecosystem for dispatching the builds.
  • Monitor agents and take them online/offline as and when required.
  • Presenting the build results (and reports) to the developer.

The Jenkins master can also execute the jobs directly but it is always recommended to select the appropriate agent(s) for build and execution-related tasks.

Jenkins Agent(s)

An agent is a remote machine that is connected to the Master. Depending on the project and build requirements, you could opt for ’N’ number of agents. agents can run on different operating systems and depending on the ‘type of build request’, the appropriate Agent is chosen by the Master for build execution and testing.

Here are the jobs handled by the Jenkins Agent(s):

  • Listen to commands from the Jenkins Master.
  • Execute build jobs that are dispatched by the Master.
  • Developers have the flexibility to run the build and execute tests on a particular agent or a particular type of Agent. The default option is Jenkins Master selecting the best-suited Agent for the job.

Here is a simple diagrammatic representation of how does Jenkins work, with multiple Jenkins Agents connected to the Jenkins Master:

Jenkins Master-Agent Architecture?

In the Jenkins Master-Agent architecture shown below, there are three Agents, each running on a different operating system (i.e. Windows 10, Linux, and Mac OS).

  • Developers check-in their respective code changes in ‘The Remote Source Code Repository’ that is depicted on the left-hand side.
  • Only the Jenkins master is connected to the repository and it checks for code-changes (in the repository) at periodic intervals. All the Jenkins Agents are connected to the Jenkins Master.
  • Jenkins master dispatches the request (for build and test) to the appropriate Jenkins Agent depending on the environment required for performing the build. This lets you perform builds and execute tests in different environments across the entire architecture.
  • The Agent performs the testing, generates test reports, and sends the same to the Jenkins Master for monitoring.

As developers keep pushing code, Jenkins Agents can run different builds versions of the code for different platforms. Jenkins Master (or Master Node) controls how the respective builds should operate.

Use case

Netflix:

Short Details of where Netflix uses Jenkins:

Jenkins is used throughout Netflix for a variety of automation tasks above just simple continuous integration. A Jenkins job is configured to invoke Nebula to build, test and package the application code. If the repository being built is a library, Nebula will publish the . jar to our artifact repository.

List of companies using Jenkins:

  • DELL
  • Lusini
  • Linkedin
  • Lutron
  • Michelin
  • Motorola Mobility (Google)
  • NASA
  • Netflix
  • Nokia Siemens Networks
  • SpaceX

More in the list…..!

Jenkins Case Study: Topdanmark:-

SUMMARY : Topdanmark, a leading Danish insurer chooses Jenkins as the “de facto” product to build their CI/CD platform.

CHALLENGE : Balancing the needs of DevOps modernization and cloud migration while maintaining legacy systems.

SOLUTION : A highly-configurable CI/CD platform which allows for automation and ease of development.

RESULTS :

  • 100% automatic creation of Jenkins instances.
  • The ability to release and deploy an artifact whenever, wherever.
  • Software developers focused on developing software rather than operations.
  • Smaller monoliths and containerization.

So we can say Jenkins is almost captured the IT market with its great features and performance…

Thank you!

--

--

No responses yet