Jenkins: Overview and Case-Study

Shubham Jangid
7 min readSep 26, 2021

Jenkins is a free and an open-source Continuous Integration server written in Java for orchestrating a chain of actions to achieve the Continuous Integration process in an automated fashion. It helps to automate complete software development life cycle of software from building, testing, documenting the software, deploying, and other stages of the software development life cycle.

Jenkins can be installed through native system packages, Docker, or even run standalone by any machine with a Java Runtime Environment (JRE) installed.

Timeline of Jenkins:

  • Kohsuke Kawaguchi, a Java developer, working at SUN Microsystems, was tired of building the code and fixing errors repetitively. In 2004, created an automation server called Hudson that automates build and test task.
  • In 2011, Oracle who owned Sun Microsystems had a dispute with Hudson open source community, so they forked Hudson and renamed it as Jenkins.
  • Both Hudson and Jenkins continued to operate independently. But in short span of time, Jenkins acquired a lot of projects and contributors while Hudson remained with only 32 projects. With time, Jenkins became more popular, and Hudson is not maintained anymore.

Features of Jenkins:

  • Easy installation: Jenkins is a self-contained Java-based program, ready to run out-of-the-box, with packages for Windows, Linux, macOS and other Unix-like operating systems.
  • Easy configuration: Jenkins can be easily set up and configured via its web interface, which includes on-the-fly error checks and built-in help.
  • Plugins: With hundreds of plugins in the Update Center, Jenkins integrates with practically every tool in the continuous integration and continuous delivery toolchain.
  • Continuous Integration and Continuous Delivery: As an extensible automation server, Jenkins can be used as a simple CI server or turned into the continuous delivery hub for any project.
  • Extensible: Jenkins can be extended via its plugin architecture, providing nearly infinite possibilities for what Jenkins can do.
  • Distributed: Jenkins can easily distribute work across multiple machines, helping drive builds, tests and deployments across multiple platforms faster.
  • Adoption: Jenkins is widespread, with more than 147,000 active installations and over 1 million users around the world.

Advantages of using Jenkins

  • Jenkins is an open-source and continuous integration server in nature.
  • As technology grows, so does Jenkins. So far Jenkins has around 320 plugins published in its plugins database. With plugins, Jenkins becomes even more powerful and feature rich.
  • Jenkins also supports cloud-based architecture so that you can deploy Jenkins in cloud-based platforms.
  • The delivery environment is provided from any language.
  • The product delivery process gets faster and thereby following the agile model in close conjunction.
  • Features like Role-Based Access Control is provided.
  • It is scalable; thereby, the availability and scalability issues can be met.
  • Distributed teams can work, and it’s easy to manage.
  • The LDAP server is an integral feature of its architecture.

Some Important Terms related to Jenkins

  • Continuous Integration (CI): Continuous integration is a practice that forces developers to frequently integrate their code into a central repository. Instead of building out new features to the end without any quality measurement, every change is tested against the central repository in order to anticipate errors.
  • Continuous Delivery (CD): Continuous delivery is the ability to make changes of all types — such as new features, configuration changes, error fixes, experiments — into production in a safe and efficient manner using short work cycles.
  • Continuous Deployment (CD):Continuous deployment, also known as continuous implementation, is an advanced stage of continuous delivery that the automation process does not end at the delivery stage. In this methodology, every change that is validated at the automatic testing stage is later implemented at the production stage.

Industry use cases of Jenkins

  • Jenkins lowers the Effort of repeated coding: Using Jenkins, one can convert a command prompt code into a GUI button click. This is done by wrapping up the script as a Jenkins job. Parameterized Jenkins jobs can be created for customization or to take user input. Thus, hundreds of lines of code writing can be saved.
  • Integration of Individual Jobs: Jenkins jobs are usually small tools. They serve small purposes and quite simple. Jenkins provides a pipeline plugin using which multiple jobs can be combined.
  • Effortless Auditing: Jenkins jobs, when run, capture console output from stdout as well as stderr. Troubleshooting with the uses of Jenkins is also very clear.
  • Synchronization with Slack: Slack integration can be done to Jenkins and thus communication such as activities that have been triggered, its time, users name, results, etc. can be shared with other people.
  • Greater data support for project management: For project management, each activity is wrapped as a Jenkins job. For each Jenkins job, success or failure can be identified, and job completion time can be measured.
  • Manual Tests option: Sometimes things work great locally but fail when pushed on a central system. This happens because, by the time they push, things change. Continuous Integration tests the code against the current state of a code base and is done in the production-like environment.
  • Avoid Broken Code during shipping: Continuous integration ensures that code coverage is good, it is tested well and only merged when all tests are successful. This makes sure that the master builds are not broken, and no broken code is shipped to a production environment.
  • Increased Code Coverage: CI servers such as Jenkins can check code for test coverage. Tests increases code coverage. This inspires transparency and accountability in team members. Results of tests are displayed on build pipeline which ensures team member follow required guild lines.
  • Code deployment to Production: Jenkins can deploy code to staging or production automatically if all the tests written for the same within a specific feature or release branch are green. This is formally known as Continuous Deployment as well.
  • Decrease Code Review Time: CI systems such as Jenkins and Version Control System such as Git can communicate with each other and inform the users when a merge request is suitable for merge. This is usually when all the tests are passed, and all other requirements are met. In addition to that, the difference in code coverage can also be reported in the merge request itself. This dramatically reduces the time taken to review a merge request.

NETFLIX using Jenkins

Netflix Inc. is an American over-the-top content platform and production company headquartered in Los Gatos, California. Founded in 1997, Netflix business deals in a subscription-based streaming service that allows it’s members to watch TV shows and movies without commercials on an internet-connected device.

Jenkins has been a central part of the Netflix build and deploy infrastructure for several years now, and we’ve been attending and speaking at JUC since it started in 2011.

Netflix uses Jenkins for continuous integration and deployment. As soon as a line of code has been built and tested locally using Nebula(A collection of Gradle plugins built by Netflix). The first step is to push the updated source code to a git repository.

Once the change is committed, a Jenkins Job is triggered. Netflix started with a single massive Jenkins master in their datacenter, and now they run 25 Jenkins masters in AWS.

Jenkins Job is configured to invoke Nebula to build, test, and package the application code. If the repository built is a library, Nebula publishes the .jar to the artifact repository and if the repository built is an application, then the Nebula ospackage(operation system package) plugin would be executed.

Using the Nebula ospackage plugin, an application’s build artifact would be bundled into either a Debian or RPM package whose contents are defined via a simple Gradle-based DSL(Domain Specific Language).

How Netflix builds code using Jenkins!!

  1. Code is built and tested locally using Nebula
  2. Changes are committed to a central git repository
  3. A Jenkins job executes Nebula, which builds, tests, and packages the application for deployment
  4. Builds are “baked” into Amazon Machine Images
  5. Spinnaker pipelines are used to deploy and promote the code change

Notice how different technologies work in harmony to provide us end service like Netflix. So ultimate goal is the integration of various technology.

Conclusion

With the multiple-choice options and plugins for build, integration, test or deploy available Jenkins, is a fantastic tool. Once a process has been automated, it requires comparatively less time to review and update meaning it can branch out and focus on working on its strong points or experiment in new fields.

Thanks For Reading

--

--