add

Jenkins – Fundamentals

Jenkins – Continuous Integration Tool

In this article, lets discuss about the continuous integration delivery in day to day IT environments.

In our daily IT lives , either its a waterfall or agile model , delivering the code build , deployment , contingency , Tracking of Deployment activities etc involves lot of pain and is much error prone due to lot of human involvement and timing.

On day of deployment , we feel like nothing moving as we see unhappy developers , clients , prod teams complaining on each other as nothing moves as per scheduled plan.

To address all these, we can make use of Continuous integration tools such as Jenkins , Atlassian Bamboo, Circle CI etc.

 

 WHAT IS CONTINUOUS INTEGRATION  AND CONTINUOUS DELIVERY ?

Continuous Integration is a process of creating a practice (daily or monthly or frequently) of streamlining the code delivery, test , schedule , deploy and monitoring tasks  with a well automated plan.

Also, the other reason being is the need for speed of software development life cycle by automating majority of the delivery to quick prod deployment.

In this article, lets discuss on one of the famous best known CI/CD tool named Jenkins which is playing the key role in Dev-opeartions area.

 

JENKINS

Jenkins is a free and open-source tool totally built on java ( therefore runs on any platform) and is widely used across small to large enterprises for their delivery and deployment activities.  Another key benefit of Jenkins is, it got the rich set of plugins and tools available that could be seamlessly integrated  which helps extending the capabilities of Jenkins.

Jenkins is a self-contained, open source automation server which can be used to automate all sorts of tasks related to building, testing, and delivering or deploying software.

 

JENKINS INSTALLATION

Installation of Jenkins can be run as WAR file or as a installer based on Operating system :

 

Windows Operating system:

 

WAR file

The Web application ARchive (WAR) file version of Jenkins can be installed on any operating system or platform that supports Java.

To download and run the WAR file version of Jenkins:

  1. Download the latest stable Jenkins WAR file to an appropriate directory on your machine.
  2. Open up a terminal/command prompt window to the download directory.
  3. Run the command java -jar jenkins.war.
  4. Browse to http://localhost:8080 and wait until the Unlock Jenkins page appears.
  5. Continue on with the post installation steps.

 

INSTALLER 

  • Download the latest Windows installer from Page :   Windows Installer
  • Open the package and follow the instructions

 

Linux Operating System

 

Debian/Ubuntu Flavors

On Debian-based distributions, such as Ubuntu, you can install Jenkins through apt.

Recent versions are available in an apt repository. Older but stable LTS versions are in this apt repository.

wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins

This package installation will:

  • Setup Jenkins as a daemon launched on start. See /etc/init.d/jenkins for more details.
  • Create a jenkins user to run this service.
  • Direct console log output to the file /var/log/jenkins/jenkins.log. Check this file if you are troubleshooting Jenkins.
  • Populate /etc/default/jenkins with configuration parameters for the launch, e.g JENKINS_HOME
  • Set Jenkins to listen on port 8080. Access this port with your browser to start configuration.

Note :

 

If your /etc/init.d/jenkins file fails to start Jenkins, edit the /etc/default/jenkins to replace the line ----HTTP_PORT=8080---- with ----HTTP_PORT=8081---- Here, “8081” was chosen but you can put another port available.

 

WHERE DOES JENKINS FITS IN ?

 

Below figure depicts the generic idea where the JENKINS CI/CD server fits in to automate our Build, Deployment and Test process.

Jenkins CI/CD
Jenkins CI/CD

Above picture depicts the various phases involved in continuous build and continuous deployments.
On a high-level, we can divide the above phases into :

1. pre-build actions
2. notifications
3. post-build actions
4. Reports

All the above items (one or more /repetitive) phases all together constitute a job and a job can be triggered manually or automatically or scheduled as per our requirement.

So before planning to convert your Manual commit, build, deploy and test process to a streamlined automated scheduled jobs through jenkins, below are the questions one should ponder and workout to avoid re-work from start.

1) Jenkins roles in various builds in your IT environment like Java , Message Broker/IIB Builds and deployments

2) Different approaches involved in Jenkins for executing the Deployments in your environments.

3) On-demand ability to fresh/re-deploy a whole environment. (ie, deploy all code at one go to make an environment ready for a planned testing)

4) The on-demand ability to deploy all code related to a SPECIFIC project or a SPECIFIC release to a SPECIFIC environment.

5) Process of automating the unit/integration/performance/load tests on a re-occurring/regular basis.

6) Pros and Cons of using Jenkins or shall i move to some other tools that offers the value i’m looking for ?

Written by Ramesh Metta


Leave a Reply

Your email address will not be published. Required fields are marked *

*
*