What is Jenkins?
Jenkins is an open-source Continuous Integration server capable of orchestrating a chain of actions that help to achieve the Continuous Integration process (and not only) in an automated fashion.
Jenkins is free and is entirely written in Java. Jenkins is a widely used application around the world that has around 300k installations and growing day by day.
It is a server-based application and requires a web server like Apache Tomcat. The reason Jenkins became so popular is that of its monitoring of repeated tasks that arise during the development of a project. For example, if your team is developing a project, Jenkins will continuously test your project builds and show you the errors in the early stages of your development.
By using Jenkins, software companies can accelerate their software development process, as Jenkins can automate build and test at a rapid rate. Jenkins supports the complete development lifecycle of software from building, testing, documenting the software, deploying, and other stages of a software development lifecycle.
Continuous Integration & Continuous Delivery are integral parts of DevOps, as they are used for integrating multiple stages of the methodology. There are many CI/CD tools in the market but Jenkins; the Java-based open-source CI/CD tool tops the popularity list.
Salient Features Of Jenkins
Jenkins is more functionality-driven rather than UI-driven hence, there is a learning curve involved in getting to know what is Jenkins. Here are the powerful developer-centric features offered by Jenkins:
1. Easy Installation & Configuration
Jenkins is a self-contained Java program that is agnostic of the platform on which it is installed. It is available for almost all the popular operating systems such as Windows, different flavors of Unix, and Mac OS.
It is available as a normal installer, as well as a .war file. Once installed, it is easy to configure using its web interface.
As it is open-source, it is free for use. There is a strong involvement of the community which makes it a powerful CI/CD tool. You can take support from the Jenkins community, whether it is for extensibility, support, documentation, or any other feature related to Jenkins.
3. Thriving Plugin Ecosystem
The backbone of Jenkins is the community and the community members have been instrumental in the development (and testing) of close to 1500+ plugins available in the Update Center.
4. Easy Distribution
Jenkins is designed in such a manner that makes it relatively easy to distribute work across multiple machines and platforms for the accelerated build, testing, and deployment.
Architecture Of Jenkins
Before we dive into how does Jenkins works, we must understand the architecture of Jenkins. These are the series of steps that outlines the interaction between different elements in Jenkins:
- Developers do the necessary modifications in the source code and commit the changes to the repository. A new version of that file will be created in the version control system that is used for maintaining the repository of source code.
- The repository is continuously checked by the Jenkins CI server for any changes (either in the form of code or libraries) and changes are pulled by the server.
- In the next step, we ensure that the build with the ‘pulled changes’ is going through or not. The Build server performs a build with the code and an executable is generated if the build process is successful. In case of a build failure, an automated email with a link to build logs and other build artifacts is sent to the developer.
- In case of a successful build, the built application (or executable) is deployed to the test server. This step helps in realizing continuous testing where the newly built executable goes through a series of automated tests. Developers are alerted in case the changes have caused any breakage in functionality.
- If there are no build, integration and testing issues with the checked-in code, the changes, and tested application are automatically deployed to the Prod/Production server.
Here is the diagrammatic representation of the Jenkins architecture:
A single Jenkins server might not be sufficient to realize the following requirements:
- Testing needs to be performed on different environments (i.e. code written using different languages e.g. Java, Python, C, etc. are committed to the version control system), where a single server might not suffice the requirement.
- A single Jenkins server might not be sufficient to handle the load that comes with large-scale software projects.
In such scenarios, the distributed (or Master-Agent) architecture of Jenkins is used for continuous integration and testing. Diving deeper into how does Jenkins works, we take a look at the architecture of Jenkins.
Continuos Integration/Continuous Development
Continuous integration is a process in which multiple commits are made every day and each commit code is built and tested immediately. Once the test is passed the build is tested for deployment and then it is sent to production. A CI/CD pipeline consists of a Continuous Integration server like Jenkins, a Source Control tool, a Build tool, and an automation testing framework like Selenium, Appium, etc. There are many benefits of continuous integration and according to the project requirement, the development team can choose the best continuous integration tools.
Jenkins at Netflix
You may know Netflix as the birthplace of open-source Spinnaker, but it is also a perennial Jenkins user. As early cloud adopters, Netflix teams quickly learned to automate build and test processes, and heavily leveraged Jenkins, evolving from “a single massive Jenkins master in our datacenter, to running 25 Jenkins masters in AWS” as of 2016.
Jenkins changed the software development and delivery game by freeing teams from rigid, inflexible build processes and moving them into continuous integration. With test and build automation, “it works on my laptop” became a moot point. A critical leap for software-centric businesses like Netflix, this ignited a spark of the possible.
As Jenkins became an open-source standard, engineers leveraged it to prove the power of software innovation, and the difference that velocity makes to improving user experiences and business outcomes. This approachable automation still works, and most of us still use it, over 15 years after its first release.
Over time, Netflix teams found it increasingly difficult to meet velocity, performance, and reliability demands when deploying their code to AWS with Jenkins alone.
Jenkins is like the soul of the continuous integration process as it builds and tests the app continuously which makes it easier to integrate changes to the process. Most of the process is automated and this saves time and effort which can be used to perform other tasks related to the delivery. It has some issues like the old UI but the benefits like an active opensource community overshadow the little disadvantages. This is why Jenkins is the most popular CI server among the developers.