World of Automation with Jenkins

Kushank Patel
9 min readMar 12, 2021

Jenkins is the Way to build, test, and deploy

In many projects, the product development workflow has three main concerns: building, testing, and deployment. Each change to the code means something could accidentally go wrong, so in order to prevent this from happening developers adopt many strategies to diminish incidents and bugs. Jenkins, and other continuous integration tools (CI) are used together with a source version software (such as GIT) to test and quickly evaluate the updated code.

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 tasks.
  • In 2011, Oracle who owned Sun Microsystems had a dispute with Hudson's open source community, so they forked Hudson and renamed it, Jenkins.
  • Both Hudson and Jenkins continued to operate independently. But in a 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.

What is Jenkins?

Jenkins is a popular self-contained, open-source automation server to perform continuous integration and build automation. Its elementary functionality is executing a predefined list of phases or jobs. In other words, every change in a repository triggers a pipeline of jobs that evaluates and executes different tasks to accomplish what has been previously defined.

Each phase is monitored and allows you to stop the entire process and the change will be reported to the user by Jenkins. In large companies, it is common for multiple teams to work on the same project without knowing what the other teams are doing on the same code base. Those changes can create bugs that will only be revealed when both codes are integrated into the same branch. Since Jenkins can run its predefined jobs for every commit, it will be able to detect and notify developers that something is not right and where it is.

Thousands of add-ons can be integrated with Jenkins, they provide support for different types of build, version control systems, automation, and more. It can be installed through native system packages, Docker, or be run by any machine with a Java environment installed. Jenkins is often used for building projects; running tests to spot bugs, analyze static code, and deploying. It also executes repetitive tasks, saves time, and optimizes developing processes.

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, solve 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 is 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. The end result is one or more artifacts that can be deployed to production.

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.

The fail-fast strategy is always of the utmost importance when deploying to production. Since every change is deployed to production, it is possible to identify edge cases and unexpected behaviors that would be very hard to identify with automated tests. 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 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 service and other tasks. Since every job can be scheduled, repetitive tasks can have the desired time interval (like once a day, once a week, every fifth day of the month, and so forth).

Advantages of using Jenkins

  • Jenkins is being managed by the community which is very open. Every month, they hold public meetings and take inputs from the public for the development of the Jenkins project.
  • So far around 280 tickets are closed, and the project publishes a stable release every three months.
  • 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 reason why Jenkins became popular is that it was created by a developer for developers.

Disadvantages of using Jenkins

Though Jenkins is a very powerful tool, it has its flaws.

  • Its interface is outdated and not user-friendly compared to current UI trends.
  • Though Jenkins is loved by many developers, it’s not that easy to maintain it because Jenkins runs on a server and requires some skills as a server administrator to monitor its activity.
  • One of the reasons why many people don’t implement Jenkins is due to its difficulty in installing and configuring Jenkins.
  • Continuous integrations regularly break due to some small setting changes. Continuous integration will be paused and therefore requires some developer attention.

Jenkins Case Study: Tymit

The idea behind Tymit began when two brothers, Martin and Nicolas Magnone, thought there should be a better long-term way to manage finances than relying on credit cards or loans. The pair felt that credit cards often have unclear pricing, lots of fees, and a lack of features to help keep balances under control. The Mangone's were convinced that they could leverage the latest payment technology to offer much better customer experiences: cheaper, flexible, transparent, and more readily available wherever and whenever it was needed. The brothers kicked things off by creating an app for family and friends that would accomplish those goals. Nicolas led the technology initiative to build a proof-of-concept. The idea took off. The app was subsequently adopted by thousands of users, and a new fintech business, Tymit, was born.

Fintech Innovation With A Jenkins Backbone

Challenge

Create a solidly reliable CI/CD platform that provides the technology team with the agility and the flexibility needed to innovate while ensuring the security and scalability their fintech service requires.

Solution

Tymit, a revolutionary credit card processing company, leveraged Jenkins to build a compliant, transparent, and secure modern DevOps platform to drive product innovation, handle instant financial transactions and support thousands of users in real-time.

Scaling cloud resources and capabilities with Jenkins

Tymit’s infrastructure supports three distinct platforms: Mobile (iOS and Android), Backend (Microservices), and Platform (Infrastructure/Security/SRE/Operations). While they are quite heterogeneous, each division requires different release schedules and management processes. For instance, Tymit could hypothetically release new versions from the backend services while simultaneously releasing new updates for the iOS and Android app. And, as the platform is continuously evolving, they perform weekly Terraform releases. The Tymit technology team uses Jenkins to orchestrate these distinct release schedules from the environment up to production.

The product and engineering teams also manage very diverse load times with varying spikes. To handle that, they use spot instances. Over a period of weeks, they may need to release software on the backend in a rapid-fire way, requiring more resources in the CI than in the mobile vertical. By using the EC2 Plugin on-demand with special labeling, they can increase those resources for specific peak times for a particular team. Once finished, the tech team can simply roll back that infra to normal within the Jenkins configuration.

Enabling secure, transparent financial transactions with a powerful CI/CD

When people’s finances are on the line, security and privacy are of paramount importance. “Being a fintech company on the road to achieving PCI DSS compliance creates a lot of challenges in terms of security,” Nicolas explained. “Because Tymit uses CI to perform for both software and platform releases, the need to have a solid and secure pipeline which does not leak any sensitive information is critical to our success.”

For this, Tymit creates ‘secrets’ within Jenkins which are either stored fully encrypted or acquired from their AWS Cloud provider to ease the deployment of certain software on different platforms. Using specific Jenkins capabilities like the Docker with Pipeline plugin the team can handle Docker images in a secured environment.

Scaling as rapidly as Tymit’s fintech rise

The technology team at Tymit feels that this platform-as-a-service solution offers more capabilities than a standard CI/CD system. And they aim to use Jenkins to integrate additional processes in their software life cycle to help scale and deliver the best quality to their customers.

They equate Jenkins to “a big Swiss Army knife” and believe that with a bit of setup, it can offer many possibilities in the software engineering world and beyond. “Jenkins has become a fundamental piece for our ‘time to market’ to deliver constant value,” Filippo Matoso, Tymit’s Product Owner, summarized.

Results

  • faster delivery of mobile, microservices, and operational services
  • reduced software testing and release cycles by 50%
  • ability to support thousands of users for real-time transactions
  • created a secure, controlled, and compliant fintech environment

Conclusion:

  • In Continuous Integration, after a code commit, the software is built and tested immediately
  • Jenkins is an open-source Continuous Integration server capable of orchestrating a chain of actions
  • Before Jenkins when all Developers had completed their assigned coding tasks, they used to commit their code all at the same time. Later, Build is tested and deployed.
  • After Jenkins, the code is built and test as soon as the Developer commits the code. Jenkin will build and test code many times during the day
  • By default, Jenkins comes with a limited set of features. If you want to integrate your Jenkins installation with version control tools like Git, then you need to install plugins related to Git
  • The biggest pros of Jenkins is that it is managed by the community which holds public meetings and take inputs from the public for the development of Jenkins projects
  • The biggest con of Jenkin is that Its interface is outdated and not user-friendly compared to current UI trends.

--

--

Kushank Patel

I am pursuing my master's degree at University of Windsor and interested in devops field.