Achieving Continuous Integration and Delivery through Jenkins

Share

Jenkins Plugin

Build automation is a booming sector and it simplifies the tasks that are commonly performed during software development. In the ‘Global Build Automation Software Market Size, Status and Forecast of 2019-2025’, Jenkins has been named as one of the key players in the build automation industry. What is so special about this build automation software? Released in 2011, Jenkins is a Java-based open-source automation service that facilitates our software development cycle. The main advantage of it is its wide range of plugins which exceeds the number of 1700. To date, around 1704 community-contributed Jenkins plugins are available to support the building, deployment, and automation of any project. CI/CD has been the buzz word in the IT world for a while now and automation solutions and open source tools like Jenkins play a pivotal role in making it happen. How do they do it? What are the key Jenkins plugins that you need to be aware of? Read on to know more.

Streamlining CI/CD with Jenkins Plugins

As mentioned, one of the notable aspects of Jenkins is the fact that it enables continuous integration and continuous delivery. The Jenkins Plugins that fundamentally enhance the functionality of Jenkins, can be downloaded and installed automatically. These plugins solve common problems with minimal effort, aid in reusability across projects and also enable CI/CD. Basic functionalities are packed as codes and only a very few inputs are required while using the Jenkins Plugins. In case we are performing the same procedures that we perform on Jenkins, outside it, we may need to do the code checkout and all other CI/CD tasks separately and hence we will also encounter manual interference. The plugins thus help us to set up configurations faster and in a smooth manner.

Previously, these operations were handled by developers on their development device. These devices already have so many other workloads than build and deployment tasks. Thus it will result in the slowing down of the CI/CD processes. Also, the other third-party application installed on the developer workstation will impact the security of the application. So it could be said that Jenkins and its plugins provide a secure and isolated environment for the build and deployment of Android applications. Jenkins will be deployed in a dedicated machine that will have sufficient resources with the capability to enable faster CI/CD executions. Also, the plugins allow us to set up complex tasks and then organize them according to the structures in the Jenkins. Jenkins plugin also provides a provision to check the progress of jobs and also view the status. It is very helpful to proactively manage Jenkins via the interface and the Jenkins pipeline plugins help us to automate the continuous delivery pipeline. Some of the plugins provide us with more visibility by issuing reports and UI diagrams about the CI/CD aspects.

Top 4 Jenkins Plugins

Based on our experience of working with the Jenkins plugins here are the top four Jenkins Plugins that you must know about.

Gradle Plugin: This plugin makes it possible to invoke a Gradle build script as the main build step. It will be installed automatically in Jenkins tools and as a prerequisite, the plugin should be installed from the Jenkins Update Centre. Also, the Gradle version should be configured at Global Configurations. The only con of this plugin is the fact that one might take some time to get acquainted with its configuration if they are new to it. Otherwise, Gradle is a very powerful plugin and could help in empowering the jobs. It also automates building and testing without disturbing the rest of the team.

AWS CodeDeploy Plugin: AWS CodeDeploy Plugin in Jenkins provides an automated deployment via Jenkins and AWS CodeDeploy. It also provides a post-build step for your Jenkins project. On a successful build, it will zip the artifacts in the workspace and upload to S3 and start a deployment process. Additionally, we can set the wait time for the deployment to finish. We used this plugin to trigger code-deployment service in AWS. The Code-deploy service was used as a deployment tool and the deployment target was EC2 instance. Integrating this plugin with Jenkins simplifies and automates CI/CD processes.

Xcode Plugin: This plugin helps execute Xcode command line tools to automate the build and packaging of iOS applications. This plugin requires a slave machine having OSX with an installed Xcode tool. Codesign certificate, Identities, and Provision profile must be installed on the build machine separately. This plug-in comes with an inbuilt feature for code coverage. Using this plugin, one doesn’t require physical access to the macOS server as we can customize the Xcode Plugin from the CI server itself.

SonarQube Plugin: This plugin allows easy integration of SonarQube which should be installed and be running in a separate place. It provides an open-source platform for the continuous inspection of code quality. Measuring code quality, identifying non-compliant code and fixing code quality issues are some of the benefits of this plugin. It also helps the developers in constantly inspecting the code, perform automatic reviews and also run analysis to detect code quality issues. In addition to this, it provides a set of features like the ability to record metrics, evolution graphs and the like. This plugin is also used to reduce the technical debt by running it on the source code and thereby fixing the code quality violations.

Use Case: Deploying an Application using AWS CodeDeploy

Let’s have a look at a real-world example of how Jenkins plugin can help you achieve continuous integration and delivery.

One of our projects which was a Java-based Microservices application was deployed on AWS. Keeping the architecture and technical specifications in mind, it was deployed using an EC2 instance and also had the ‘Auto Scaling’ feature.  In the early stages, the development team had handled the build and deployment manually from their machine. Also, the ASG Launch configuration update needed to be done in each release and these activities were very lengthy and time-consuming. Because each of the Microservices should deploy to a standalone EC2 and then a launch configuration has to be created from that, EC2 and ASG should be updated with the latest launch configuration. Thus it was very difficult to maintain the application without downtime during the release process and also by increasing the number of services the outage also increased accordingly. 

The AWS CodeDeploy service and its Jenkins plugin helped us to tackle this scenario more efficiently. As the name suggests, AWS CodeDeploy is a service available in AWS for code deployment of two types: ‘in-place’ and ‘blue-green.’ The in-place deployment will have an out-age in application functionality during the release as it will be replacing the existing version with a new version and the latter might take up some time to take traffic. However, the blue-green deployment handles the deployment and validation of service parallel to the existing version and the traffic will be switched only after the successful validation of the application.

CodeDeploy can be managed via Jenkins using its plugin. All the necessary configurations can be given as inputs in the Jenkins plugin console. After the build process, Jenkins will trigger the AWS CodeDeploy as a post-build activity so that all the necessary changes will be done.  Previously, each Microservices deployment was a separate activity but here in Jenkins, we were able to run parallel jobs of each service and thus the build and release time reduced drastically. Now we are not required to create a launch configuration, AMI creation on each release and also we don’t have to update ASG manually for rolling the new updates and also we don’t have to face any application downtime.

Being open-source and user-friendly, Jenkins is a very comfortable and easily configurable software. It enables CI/CD and also saves money and time spent on the project. Since most of the integration work in it is automated, there are negligible chances of integration issues. Jenkins provides a wide range of plugins to choose from and one could also deploy any number of them for enhanced productivity. The CI/CD landscape has witnessed tremendous changes in the past decade. Even though Jenkins has been successful since its inception, it has to provide faster development pace with increased stability if it needs to stand the test of time.

By,
Adarsh TS
Senior Cloud Engineer, RapidValue

Please Share Your Thoughts & Comments Below.

How can we help you?