Jenkins For Continuous Integration

Chetna Manku
6 min readMar 12, 2021

Jenkins is an open source, cross-platform automation server that helps to automate the software deployment process. It is used to continuously build and test software projects, enabling developers to set up a CI/CD environment.

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.

🔰 Jenkins Features 🔰

Jenkins offers many attractive features for developers:

  • Easy Installation : Jenkins is a platform-agnostic, self-contained Java-based program, ready to run with packages for Windows, Mac OS, and Unix-like operating systems.
  • Easy Configuration : Jenkins is easily set up and configured using its web interface, featuring error checks and a built-in help function.
  • Available Plugins : There are hundreds of plugins available in the Update Center, integrating with every tool in the CI and CD toolchain.
  • Extensible : Jenkins can be extended by means of its plugin architecture, providing nearly endless possibilities for what it can do.
  • Easy Distribution : Jenkins can easily distribute work across multiple machines for faster builds, tests, and deployments across multiple platforms.
  • Free Open Source : Jenkins is an open-source resource backed by heavy community support.

🔰 Industries using Jenkins 🔰

Looking at Jenkins customers by industry, we find that Computer Software (27%) and Information Technology and Services (11%) are the largest segments.

🔰 Jenkin History 🔰

  • 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.

🔰 Jenkins use cases 🔰

Let’s take a look at some of the main scenarios Jenkins plays a critical part in.

👉 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.
  • Every developer commits daily to a shared mainline and every commit triggers an automated process to build and test.
  • If building or testing fails it can be detected and fixed within minutes without compromising the whole structure, workflow, and project.
  • In that way, it is possible to isolate problems, solving them faster and provide higher-quality products.

👉 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.
  • The main goal in continuous delivery is to make deployments predictable as routine activities that can be achieved upon request.
  • To be successful, the code needs to always be in a deployable state even when there is a scenario with lots of developers working and making changes on a daily basis.
  • All of the code progress and changes are delivered in a nonstop way with high quality and low risks.

👉 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.
  • To fully take advantage of continuous deployment, it is important to have solid logging technology that allows you to identify the increasing error count on newer versions.
  • In addition, a trustworthy orchestration technology like Kubernetes that will allow the new version to slowly be deployed to users until the full rollout or an incident is detected and the version is canceled.

👉 Automation

  • As a job executor, Jenkins can be used to automate repetitive tasks like backup/restore databases, turn on or turn off machines, collect statistics about a service and other tasks.
  • Since every job can be scheduled, repetitive tasks can have a desired time interval (like once a day, once a week, every fifth day of the month, and so forth).

🔰 DevOps Use Case: Using Github, Jenkins and Docker 🔰

Dev and Ops are no longer exclusively separate roles within the IT space.

The CI workflow described in this article is composed of three steps.

  • The developer first pushes a commit to GitHub, which in turn uses a webhook to notify Jenkins of the update.
  • Jenkins can then pull the GitHub repository, build the Docker container which contains our stack and then run the test.
  • If the test passes, Jenkins will push the code to the master branch.

🔰 Success Story : Nokia 🔰

  • In a software product development project at Nokia, there was a process called Nightly builds.
  • Nightly builds can be thought of as a predecessor to Continuous Integration. It means that every night an automated system pulls the code added to the shared repository throughout the day and builds that code.
  • The idea is quite similar to Continuous Integration, but since the code that was built at night was quite large, locating and fixing of bugs was a real pain.
  • Due to this, Nokia adopted Continuous Integration (CI). As a result, every commit made to the source code in the repository was built.
  • If the build result shows that there is a bug in the code, then the developers only need to check that particular commit.
  • This significantly reduced the time required to release new software.

🔰 Success Story : LTI 🔰

According to LTI (Larsen & Toubro Infotech Limited), they have monthly releases which consists a lot of manual efforts for unit testing, deployment to different environments, system testing, staging deployment, etc. With implementation of CI, manual efforts are cut down by 75%, by automating complete process right from unit testing till deployment to staging.

  • Bug fix cost : Before CI, the team used to fix the bugs once QA testing is in progress. With implementation of CI, bugs got detected as and when the code got checked in, in the repository and helped in eliminating 75% of the development efforts.
  • Deployment cost : AES team (deployment team) used to take 4 hrs. for deployment per release, which is now reduced to 10 mins.
  • Cost of delay : Before CI, features are held on average 6 weeks after development completion before they are released. Now with CI in place features are released as and when they are ready.

🔰 Conclusion 🔰

With great progress in software technologies, Companies requires development teams to produce and deliver high-quality software better and faster than their competition.

Uses of Jenkins can save a lot of time for developers, improves code quality and coverage and provide management great control over software development. Thus, It is very well appreciated and a lot of companies uses it on a daily basis.

In the future, CI will have an even greater influence than it has today. Moving from Continuous Integration to Continuous Delivery, and deployment is the future.

--

--