Jenkins – Fundamentals
Jenkins – Continuous Integration Tool
- 634 Views
- No Comments on Jenkins – Fundamentals
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 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.
Installation of Jenkins can be run as WAR file or as a installer based on Operating system :
Windows Operating system:
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:
- Download the latest stable Jenkins WAR file to an appropriate directory on your machine.
- Open up a terminal/command prompt window to the download directory.
- Run the command
java -jar jenkins.war.
- Browse to
http://localhost:8080and wait until the Unlock Jenkins page appears.
- Continue on with the post installation steps.
- Download the latest Windows installer from Page : Windows Installer
- Open the package and follow the instructions
Linux Operating System
On Debian-based distributions, such as Ubuntu, you can install Jenkins through
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/jenkinsfor more details.
- Create a
jenkinsuser to run this service.
- Direct console log output to the file
/var/log/jenkins/jenkins.log. Check this file if you are troubleshooting Jenkins.
/etc/default/jenkinswith configuration parameters for the launch, e.g
- Set Jenkins to listen on port 8080. Access this port with your browser to start configuration.
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.
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
3. post-build actions
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 ?