Continuous Integration & Continuous Deployment With Jenkins
Interview QA

What Is CI & CD And Advantage Of Jenkin

 What is Jenkins and why we use it?

Jenkins is an open-source automation server written in Java with lots of plugins for building, deploying, and automating projects.

It is used to build and test your application continuously which makes it easier for developers to integrate changes to the application and making it easier for users to get the latest build. It allows the continuous delivery of software by integrating with many testing and deployment technologies.

With Jenkins, companies can speed up the software development process using automation. Jenkins combine all kind of development processes, including build, document, test, package, stage, deploy, static analysis, and much more.

This tool accomplish Continuous Integration with the help of plugins. Jenkins can integrate various DevOps stages by utilizing plugins. If you want to integrate a tool, you need to install the plugins for that tool. Such as: Git, Maven 2 project, Amazon EC2, HTML publisher, etc.

Below image shows that Jenkins is integrating with various DevOps stages:

 Advantages of Jenkins include:

  • It is an open source with great community support.
  • Jenkins is easy to install.
  • It supports many plugins. If a plugin does not exist, you can code it and share it with the community.
  • It is built Java-based, so portable to all the major platforms. 

Jenkins Features

Following are features of Jenkins which make it different from other CI (Continuous Integration) Tools:

  • Adoption: Jenkins is universal, with more than 147,000 active installations and over 1 million users around the world.
  • Plugins: Jenkins relates to more than 1,000 plugins that allow it to accommodate most of the development, testing, and deployment tools.

From the above points, we can conclude that Jenkins has a very high demand globally. Before discussing further about Jenkins, it is important to know what Continuous Integration is and why it was introduced.

What is Continuous Integration?

Continuous Integration is a process where developers commit source code into a shared repository frequently. Every source code commit made in the repository is subsequently built. This helps the team to find the defects at early stage. Apart from this, based on CI Tool, there are some other functions like deployment of build on test environment, giving the concerned team the build and test results etc. Let us understand its importance with a use-case.

Continuous Integration Example:

Nightly builds served as a precursor to Continuous Integration.Nightly builds guarantee that an automated system fetches the code committed throughout the day and builds it every night.. The process was like Continuous Integration, but since the code that used to build at night was quite huge, bug fixing was a real pain. Due to this, the concept of Continuous Integration (CI) came into picture. As a result of CI, if the build result shows the bug in the code, then the developers only need to check that particular commit. This reduced the time needed to release new software.

 Continuous Integration with Jenkins

Let’s discuss a scenario where we built the entire source code of the application and then deployed it on the test environment for testing.It seems to be in a perfect way to develop an application, but this process has many faults. Let’s discuss these flaws one by one:

  • Developers must wait until they have developed the entire software to obtain the test results.
  • There will be high possibility that the test results might show multiple bugs. It will be tough for developers to find out those bugs because they have to check the complete source code of the application.
  • It will slow the software delivery process.
  • The whole process was manual which can increase the risk of frequent failure.

So, the above-mentioned problem will not only slow down the software delivery process but will also impact the quality of software. This will result in customer dissatisfaction. So, to avoid such situations there was a need for a system to exist where developers can continuously hit a build and test for every commit made in the source code. This is what CI is all about. Jenkins, being the most developed CI tool available, let’s explore how it overcame the above shortcomings in Continuous Integration.

Below flow diagram of Continuous Integration with Jenkins is self-explanatory, how Jenkins overcomes the above problems:

  • Developers commits the code to the GIT repository. The Jenkins server checks the changes in repository at regular intervals.
  • Once the commit is complete, the Jenkins server detects the changes in the git repository. Jenkins will pull those changes and will start creating a new build.
  • If the build fails, the concerned team receives a notification.
  • If build is successful, then Jenkins deploys the built in the test Environment.
  • After testing, Jenkins creates a feedback and then inform the developers about the build and test results.
  • It will continue to check the source code changes in the repository and the entire process keeps on repeating.

Following table will show the comparison between “Before and After Jenkins”.

Before and After Jenkins

Before JenkinsAfter Jenkins
The complete source code was built and then tested. Bug detection and in the event of build and test failure was critical and time-consuming, which slows the software delivery process.Every commit done in the source code is built and tested. So, instead of checking the entire source code developers only need to focus on a commit. This leads to frequent new software releases.
Developers must wait for test resultsDevelopers know the test result of every commit made in the source code on the run.
The process is manualCommit in source code is required and Jenkins will automate the rest of the process.

http://www.csueastbay.edu

https://www.softwaretestingleaders.com/

One Reply to “What Is CI & CD And Advantage Of Jenkin

Leave a Reply