Skip to main content

Jenkins : An Introduction


Jenkins is an automation tool, primary used to build, release and deploy applications in an automated fashion (Continuous Integration and Continuous Deployment CI/CD). The first step towards exploring this automation tool is to configure this locally.

Jenkins can be installed in different ways (locally in a docker container, in an EC2 instance, Azure VM etc..,) which is clearly described in the official documentation below,

Installing Jenkins

To learn Jenkins, it is always better to setup the environment locally. Using docker is one of the convenient methods to run jenkins, since the container can be deleted any time and started a fresh, if anything is misconfigured or not working, while we explore.

Steps to run Jenkins in Docker:

1. Create a new folder and save the below docker-compose.yaml.

version: '3.7'
services:
     jenkins:
       image: jenkins/jenkins:lts
       privileged: true
       user: root
       ports:
         - 8081:8080
         - 50000:50000
       container_name: jenkins
       volumes:
         - "./jenkins_config:/var/jenkins_home"
         - "/var/run/docker.sock:/var/run/docker.sock"
         - "/usr/bin/docker:/usr/bin/docker"

2. Create a folder "jenkins_config" to store all the jenkins data in the host system, this avoids setting up jenkins again while starting the new container.

Below command is used to start the jenkins server in port 8081 in docker.

docker compose -f <docker-compose-file> up --build -d

Once the jenkins is successfully up and running, execute the command "docker ps -a", would yield the below output,

C:\Anbu\Jenkins>docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAME
5686cb9255be jenkins/jenkins:lts "/sbin/tini -- /usr/…" 14 seconds ago Up 12 seconds 0.0.0.0:50000->50000/tcp, 0.0.0.0:8081->8080/tcp jenkins

Logs of the jenkins container:

C:\Anbu\Jenkins>docker logs -f 5686cb9255be
Running from: /usr/share/jenkins/jenkins.war
webroot: EnvVars.masterEnvVars.get("JENKINS_HOME")
2021-12-22 07:44:59.975+0000 [id=1] INFO hudson.WebAppMain#contextInitialized: Jenkins home directory: /var/jenkins_home found at: EnvVars.masterEnvVars.get("JENKINS_HOME")
*************************************************************
*************************************************************
*************************************************************
Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:
7c63e931bd864d94b8739788d03e29c9
This may also be found at: /var/jenkins_home/secrets/initialAdminPassword
*************************************************************
*************************************************************
*************************************************************
2021-12-22 07:45:33.479+0000 [id=66] INFO h.m.DownloadService$Downloadable#load: Obtained the updated data file for hudson.tasks.Maven.MavenInstaller

Launch Jenkins in your browser by opening the link http://localhost:8081. It will walk you through the initial one time setup. Provide the password printed in the logs to start with the setup and install all the recommend plugins.

Optionally, use the below command inside the Jenkins container to install the AWS CLI, if you are deploying your stack in AWS.

apt-get install -y \
      jq \
      groff \
      python3-pip \
      python &&\
      pip install --upgrade \
      pip \
      awscli 

Jenkins Plugin:

Plugin adds extra capabilities to Jenkins and helps us in building the Jenkins file to automate our process. Notable Jenkins plugin are,

  1. pipeline - used to code declarative pipeline
  2. pipeline utility - contains utility functions like unzip, zip.
  3. docker - used to build docker images in the pipeline.
  4. Amazon ECR - to push the docker images to AWS ECR.

Please refer to the pipeline syntax (official documentation) for building Jenkins file. 

A Sample Spring boot Microservices project with Jenkins Pipeline is available in this link for reference.

Comments

Popular posts from this blog

How to get 5GB instantly in seedr?

Seedr is a torrent caching site which provides 2GB of caching for free. For those who are not aware of what the torrent is?  Torrent is a peer to peer communication protocol (P2P) for file sharing. It was introduced in the mid of 2001 for decentralizing the file sharing in this real world. How the files are shared via torrent? Files are uploaded to servers as we do traditionally but the interesting part comes here, these files can be downloaded only via torrent client like Bit torrent, µtorrent, Vuze or you can use any other clients available in the market. Just do a google search to find all the available clients for downloading files.  Why they are restricting the download to clients? Because, the concept here is each computer acts as a server, once you start the download, the client will start uploading the data. Someone on the internet will download the same file based on the data you upload, this process is called seeding, thus decentralizing the data and reducing t

Decision making statements - T24

As a programmer, it is essential for you to make your program to work better in all the cases. So, based on the real-time data, you have to decide how the program should work. So, it is important to take decision. Consider a simple case where you want to print the number provided by the user at runtime is even or odd. How to handle that in programs? Decision making statements comes in to play. So, what is the syntax and how to use that? IF condition THEN                 This block will execute when the if condition is satisfied or validated to true. END This is the syntax of the simple IF block. Ok. If the condition is not satisfied, then what will happen. I need to do something when IF condition is failed. How to handle that? ELSE block should be introduced. Here is the syntax, IF condition THEN                 This block will execute when the if condition is satisfied or validated to true. END ELSE                 This block will execute when the i

Hello World - Getting Started with T24

Are you looking to develop great modules and local services for T24? This is the perfect place to start with. Let’s start from the basics. The core banking platform, T24 is developed with INFOBASIC code. This is the proprietary language of Temenos. T24 has the unique compiler to convert the BASIC code to object files with TAFc (Temenos Application Framework c) platform. An another flavour TAFj (Temenos Application Framework java), converts the BASIC to bytecode making it capable to run on any device with the Java runtime installed. The BASIC code remains same for both TAFc and TAFj Platform. Enough Intro! Let’s say hello to this world, How the syntax of this basic program looks like, PROGRAM program_name all the basic statements reside inside this block END Now, it is right time say hello, PROGRAM HELLO                 CRT “Hello World” END Yah, we did that. But, how to run this. You need T24 deployed in your organisation to compile and run