JENKINS: CASE STUDY

Avadhut Shinde
10 min readMar 12, 2021

WE WILL COVER FOLLOWING TOPIC:

  1. Reasons Jenkins Is So Useful and Popular
  2. What Is Jenkins?
  3. What Is Continous Integration, and Its Tool
  4. Features Of Jenkins
  5. Jenkins Architecture
  6. Jenkins: Case Study

Reasons Jenkins Is So Useful and Popular:

We use Jenkins quite a lot, for almost everything in my daily work. Not to mention the CI/CD part. We achieve regular deployment with Jenkins. Daily backup and weekly cleanup from Jenkins. Vulnerability scanning from Jenkins. Workflow enforcement with Jenkins. And the list goes on and on.

But just several years ago, Jenkins (as Hudson, its old name) wasn’t that well-known. And now? It is almost everywhere. Jenkins is just so important! So answer me: Why is that? Reasons driving the change.

1. Lowers the Effort of Converting CLI to GUI

Everybody loves the one-button click philosophy, both users and engineers. The truth is, lots of system admins prefer CLI. So why? Is it because all of the IT professionals are nerds and jerks? Well, maybe…

Implementing reliable scripts takes time, but adding decent UI support takes even longer.

Now, with Jenkins, visual ops are much easier to achieve. To convert a CLI into a GUI button click, just wrap up the script as a Jenkins job. To support customization and obtain users’ input? Create parameterized Jenkins jobs.

Tons of undocumented scripts versus organized Jenkins jobs. It’s not a hard decision for you, right?

2. The Pipeline Integrates Individual Jobs for a Bigger Purpose

Imagine that individual Jenkins jobs are small tools. They all serve simple and small purposes. With the Jenkins pipeline plugin, we can combine multiple jobs together, which then serves a bigger problem. The combination could be either sequential or parallel.

As a Linux veteran, you know the value of pipelines, don’t you? It makes a huge difference.

3. Keeps People in Sync, Especially in Slack

Nowadays, teams tend to use one centralized platform for communication. Slack is the most popular one. Let’s say all critical activities are implemented and triggered by Jenkins. Adding Slack integration to Jenkins, people can be notified of what activities have been triggered, when, by who, and the results.

The most beautiful part is: no extra human effort is required. Everything is done automatically.

4. Auditing the Previous Run Is Possible and Effortless

When Jenkins runs jobs, it will capture console output, for both stdout and stderr.

For troubleshooting, we know the history, crystal clear. No need for a human to capture the console output and spend time organizing it in a user-friendly way. The time saved for communication is huge!

For performance tuning, we know how long each run took. Even for each individual job run, we can easily identify the slowest steps with the help of the Timestamper plugin.

5. Project Management Now Has More Accurate Data Support

For project management, we know more about the status for each part, and this can be done automatically. Each activity can be wrapped as a Jenkins job. For each Jenkins job, we know whether it succeeds or fails, and we also know how long it takes.

Plus, Jenkins supports REST API or SDK to poll these metrics. Project management can now have more solid and accurate data support. The Dashboard View plugin can be your friend for this.

What Is Jenkins?

Jenkins is a free and open-source automation server. It helps automate the parts of software development related to building, testing, and deploying, facilitating continuous integration and continuous delivery. It is a server-based system that runs in servlet containers such as Apache Tomcat.

Jenkins is an open-source automation tool written in Java with plugins built for Continuous Integration purposes. Jenkins is used to build and test your software projects continuously making it easier for developers to integrate changes to the project, and making it easier for users to obtain a fresh build.

Continuous Integration And Its Tools :

“In software engineering, continuous integration is the practice of merging all developers’ working copies to shared mainline several times a day. Grady Booch first proposed the term CI in his 1991 method, although he did not advocate integrating several times a day.”

“Continuous Integration (CI) is a development practice where developers integrate code into a shared repository frequently, preferably several times a day. Each integration can then be verified by an automated build and automated tests. While automated testing is not strictly part of CI it is typically implied.

Continuous Integration Tools

1. Buddy

Buddy is a web-based, self-hosted Continuous Integration (CI) and Continuous Delivery (CD) tool also known as Buddy.Works.Buddy is a serious advancement as one of the trusted CI-CD tools. It has an extremely friendly user-interface and is also the simplest tool to use for web developers, designers, and quality assurance teams. Git developers can use this tool for building, testing, and deploying the websites and applications using Github, Bitbucket, GitLab codes.

Key Features:

  1. Steps for launching containers, automating deployment, and setting up monitoring can be easily customized
  2. Build, Ship, and Deploy as inbuilt stack feature
  3. Can be deployed to any hosting and cloud service providers
  4. Supports Grunt. Gulp, MongoDB, and MySQL
  5. Real-time reports on progress, logs, and history can be monitored

6. Docker-based builds and tests.

2.TeamCity

Teamcity, first released in 2006 is a Continuous Integration tool developed by JetBrains. It runs in a Java environment and is used to build and deploy different projects. It supports integration with many cloud technologies like Microsoft Azure, VMWare, Amazon.

Key Features:

  1. It is free of cost Continuous Integration tool

2. Supports platforms like Java, .Net, and Ruby
3. Allows easy integration with IDEs like Eclipse, IntelliJ IDEA, Visual studio
4. Allows code coverage, inspection and performs duplicates check and creates history
reports of any changes made
5. It supports running multiple builds and tests under different platforms and environments.

3. Bamboo CI

Bamboo is another Continuous Integration (CI) and Continuous Deployment (CD) software developed by Atlassian. It is written in Java and supports other languages and technologies like CodeDeply, Ducker, Maven, Git, SVN, Mercurial, Ant, AWS, Amazon, etc. The tool performs an automatic build, testing, and deployments. Automation thus saves time and allows developers some extra time to focus on the strategic aspects of the product.

Key Features:

  1. Bamboo can build, test and deploy multiple projects simultaneously and in case of any build failure, it provides the analysis and the failure reports
  2. The current status of the builds and server status can be monitored with the help of the REST API provided by Bamboo
  3. Bamboo supports testing tools like PHPUnit, JUnit, Selenium
  4. It is compatible with JIRA and BitBucket
  5. Bamboo is related to other products like JIRA, Confluence and Clover by Atlassian allowing the developers and the other team members to be at the same page 6. It can also import data from Jenkins.

4.GitLab CI

GitLab Continuous Integration tool is a complete code management platform with multiple mini tools each performing a different set of functions for the complete SDLC. It is owned by GitLab Inc and was created by engineers Dmitriy Zaporozhets and Valery Sizov. It provides important analysis on the code views, bug management, CI-CD in a single web-based repository which also makes it the most demanded CI-CD tool. GitLab CI is written in Ruby and Go and its core functionality is released under an open-source MIT license, keeping the rest of the functions under a proprietary license.

Key Features:

  1. It is directly integrated with the GitLab Workflow
  2. Allows all critical information on the code progress in a single dashboard
  3. Free for the community edition, enterprise version is paid one
  4. Language Programming CMD build scripts available allowing to program them in
    any language
  5. APIs are provided to allow better product integrations

Jenkins offers many attractive features for developer

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. As a part of our learning about what is Jenkins, let us next learn about Jenkins architecture.

Jenkins Architecture

  • Developers commit changes to the source code, found in the repository.
  • The Jenkins CI server checks the repository at regular intervals and pulls any newly available code.
  • The Build Server builds the code into an executable file. In case the build fails, feedback is sent to the developers.
  • Jenkins deploys the build application to the test server. If the test fails, the developers are alerted.
  • If the code is error-free, the tested application is deployed on the production server.

The files can contain different codes and be very large, requiring multiple builds. However, a single Jenkins server cannot handle multiple files and builds simultaneously; for that, a distributed Jenkins architecture is necessary.

Now you can understand the Master-Slave architecture in this What is Jenkins article.

Jenkins Master-Slave Architecture

As you can see in the diagram provided above, on the left is the Remote source code repository. The Jenkins server accesses the master environment on the left side and the master environment can push down to multiple other Jenkins Slave environments to distribute the workload.

That lets you run multiple builds, tests, and production environments across the entire architecture. Jenkins Slaves can be running different build versions of the code for different operating systems and the server Master controls how each of the builds operates.

Supported on a master-slave architecture, Jenkins comprises many slaves working for a master. This architecture — the Jenkins Distributed Build — can run identical test cases in different environments. Results are collected and combined on the master node for monitoring.

Mooncascade is a leading software and product development company in Estonia. Mooncascade works with local and international customers, mainly in the telecom, defense, finance, and startup sectors across Europe, and is often brought on board when companies need to set up an innovation arm and do rapid prototyping.

  • Industry: Computer Software
  • Headquarter: Tartu, Estonia
  • Company size: 70

The real problems with Jenkins started when the Mooncascade iOS team needed to migrate their code to the newest Swift version in Xcode. For them, it basically meant that they had to provide an extra server, configure the project to be built on machines and hire a DevOps “Jenkins pro” to manage the hardware and software.

“First, you have to configure build scripts and then set up the environment with all the necessary webhooks and project repositories,” explains iOS developer Alvar Hansen. “We always had to find a setup for similar projects, but we could never be sure that the built environment and configured plugins were error-free. And in case of integration errors, we had to look for solutions from open source communities.”

Getting all the projects up and running and managing the code signing certificates requires a heavy load of system administration. Nevercode took the responsibility for the annoying part that the iOS developers did not want to spend their precious time on — that is managing multiple build servers and software versions.

“Managing hardware and software on build servers was not our problem anymore. It was Nevercode’s problem. Actually, in that sense there was no problem anymore.”

— Alvar Hansen, iOS Developer

Project setup with Nevercode is extremely simple. Compared to Jenkins, it’s super easy to see the information about the build environment. Nevercode’s UI allows you to see what kind of features and plugins you may configure for your project.

“All you have to provide is a repository URL, provisioning profiles and signing certificates, and the project is up and running! There is no extra stress about conflicting projects. It’s all done automatically,”

— Karl Puusepp, iOS developer at Mooncascade.

--

--