Jenkins : A must know CI CD Tool

Introduction

Shipping your product just after you have committed your changes in code. Automatic Build, Running Test Scripts, Release to your artifactory. Ya Continous Integration is the exact thing I am talking about.

Jenkins is the most popular CI-CD tool available out in the market nowadays.

As always to kick-start a new tool the official documentation is good but not the ideal solution as it can be a bit high level.

Jenkins has its official tutorial: Jenkins Tutorial

Recommendation Tutorial Articles:  Jenkins Tutorials Point Tutorial

Overview
Installation

Download Jenkins from its official website: Jenkins Download. Download the corresponding installer for your operating system.

Install the installer via the wizard and do the required steps on wizard-like setting the default port, admin username, and password.

My personal suggestion is to go with Stable-LTS (Long Term Support) version.

Installation is an easy task, after installation, the Jenkins server will start at localhost:8080 (unless any other Jenkins port is specified) and will ask for installation of plugs, its better to go with recommended ones as its the commonly used plug-ins and it will be handy.

I installed Jenkins in Windows as the steps are exactly the same as in the Jenkins site. Hoping it will be as easy for other systems too, in case you have any issues in installing Installation Steps for each OS is available.

Do note that any parameters that were configured while installation can be changed afterward, there is always a "Forgot Password" option. Only a point to remember is that some configurations can be changed only before starting the Jenkins server. Again official doc is available for conf changes.

First Run

Before the first run, let's just explore by logging into Jenkins that we had set up. Pretty simple UI!

Security

Jenkins is interacting with so many sites within it and the first thing that comes into mind is the credentials shortage. Jenkins got us covered on that Credentials Binding plugin. We have the provision to set the credentials on a global level or deep low to job level configure.

That's good security, but there is one more requirement for security. To give access to multiple users to Jenkins. Jenkins gives this provision in its Configure Global Security (in Manage Jenkins from Jenkins Home)

More detail on Jenkins Security.

Initial Setups 

Step One is to let Jenkins know all the details like where the code is, where to ship it etc, or in CI-CD terms details of third party sites which are used in each stage.

Blue Ocean helps you to create the entire flow easily with its web interface and creates you a Jenkinsfile which all you have to do is create a Pipeline project (Jenkins Home > New Item > Enter a name > Select Pipeline) or if you edit an existing pipeline project Configure and add the Jenkinsfile in the Jenkinsfile tab. Test your Jenkins project by Build Now and check the Console Output of that build.

Pipeline as code is supported by Pipeline DSL (Domain Specific Languages) like Groovy.

Performance

Jenkin's jobs are getting big and complex as more and more pipelines are been added nowadays. And hence performance monitoring of the jobs have been a requirement and here too Jenkins go us covered. It deals with this requirement also with another plugin Performace Plugin which too can be configured from the Jenkins dashboard and after configuration of the plugin Performace Reports can be viewed from the Jenkins dashboard.

More detail on Jenkins Performance.

Pre Requistic Knowledge

Maven - The build tool for Java Projects. Seen a POM.XML in your project, that's a maven project. Visit the official site for more info.

Installation is an easy process, all you have to do is download the bin folder of apache maven, unzip it. Set or add Environment variable PATH to the bin folder location. Starts it. mvn starts working.
If you are using an IDE majority of those are inbuild with this.

Comments

Popular posts from this blog

Places to Visit In Kochi

Oracle University Learning Subscription

ELK : A Killer Solution for Log Analysis