CICD Project

  • By
  • June 3, 2022
  • DevOps

Introduction to CICD:

CICD is a term which is derived from CI and CD, CI stands for Continuous Integration and CD stands for Continuous Delivery/Deployment. In term Continuous Integration continuous building and testing the code of applications which is under the development process. In term Continuous Delivery process of deploying the new versions of an application continuously as per the development and frequently changes or up gradation.

When combine CI and CD together it empower the organizations to design and deliver one of the best quality software to customer within short development life cycle and customer satisfaction. It CICD term design to increase the speed of development and release fully tested application to the end user. It achieve the whole process with help of automation tools so it remove the so many barriers in development and deployment process which is very useful for every organization to release one of the best product in market in shorter time span and customer satisfaction.  

For Free, Demo classes Call: 02071177392
Registration Link: Click Here!

CICD are the pillars of DevOps. Where we can create full automation pipeline of software development life cycle which based on fully automation tools. Here we create one of the sample project on CICD Pipeline.

CICD Project (Use Host OS Windows 10 for following steps-

Required Tools to complete CICD Project:

  1. Git-2.35.1.2-64-bit
  2. jre-8u321-windows-x64
  3. jdk-18_windows-x64_bin
  4. apache-tomcat-9.0.62
  5. apache-ant-1.9.16-bin
  6. jenkins.war

Step 1. Install Git –

Go to Google – search “git download” download 2.32 for windows (updated one)  – click to download.

Open download file – c: \programfiles\git- next – next- use default vim editor – git from the command line and also from the 3rd party software- use the open ssl library-checkout as unix-style line endings- check out as is – use Mintty – default -git credential manager- – enable file system caching install.

 

Step 2: Install jre-8u321-windows-x64 

Install jre with default settings and default location 

For Free, Demo classes Call: 02071177392
Registration Link: Click Here!

 

Step 3: Install jdk-18_windows-x64_bin

Download and install jdk 18 with default settings

go to C drive -programming files-java-jdk18 – select path and copy it.

Search ‘edit system environment variables- environmental variable – go to user variable- new – 

Variable name- JAVA_HOME

Variable Value- paste the path here,

 

Now go to system variable – new

Variable name – JAVA_HOME

Variable value – paste the same here

 

now go inside program file – bin -copy the path.

Again go to “edit system environment variable-  path  – new – paste path.

 

Now verify on command prompt-

c:\user\name\echo %JAVA_HOME%

 

O/P: C:\Progrmefiles\Java\jdk-16

or

java -version

 

Step 4: apache-tomcat-9.0.62 –

Download and install apache tomcat

(https://tomcat.apache.org/download-90.cgi)

 

username admin

password 111

 

set automatic start up for tomcat start every boot process

 

open web-browser

http://localhost:8080

login admin

pass  111

 

Step 5 jenkins.war

DOWNLOAD JENKINS WAR FILE – paste it webapp location (https://www.jenkins.io/download/)

 

Create directory ‘C:\JENKISNHOME’

Now go to  system variale – new

 

variable name – JENKINS_HOME

Variable value – paste the same  here

 

Copy jenkins.war file and paste it c:\programming files\Apache Software Foundation\Tomcat9.0\webapps\

 

open web-browser

http://localhost:8080

login admin

pass  111

 

start jenkins

 

http://localhost:8080/jenkins

 

login in jenkins with respective password,without any plugins, set username=admin password=111

For Free, Demo classes Call: 02071177392
Registration Link: Click Here!

 

Step 7. Now donwload Ant

 

https://ant.apache.org/bindownload.cgi

 

extract it- into c:\apche-ant-1.9.16

 

set path environment variable “ANT_HOME” c:\apche-ant-1.9.16

set path system variable-path c:\apche-ant-1.9.16\bin

 

Verify

open cmd

ant -version

Restart system

 

Step 8. Clone code

 

go to c drive and create directory

win+r

cmd

 

mkdir c:\gitworkinghub

cd c:\gitworkinghug

 

git clone https://github.com/hackwithabhi1/webapp.git

 

Step 9. Create jenkin job to pull code

 

Open web browser

http://localhost:/8080/jenkins

 

Manage jenkins – manage plugins – available- github – install without restart.

Dashboard- new time- githubpull – free style project – ok.

 

github pull – configure – general – advance – use custom workspace {JENKINS_HOME}/workspace/webapp

 

source code management – git -copy github repo url and past.(https://github.com/hackwithabhi1/webapp.git) – Apply – save.

 

Step 10. Continuous Build, code review and publish result

 

Manage jenkins – manage plugins – Ant & waring next gen plugins – install without restart.

 

New item – buildandcodereview – freestypeproject – ok.

 

General – Advanced  – use custom workspace.${JENKINS_HOME}/workspace/webapp

 

souce code management -at – paste the url of webapp from github – Build – invoke ant.

post build action -(Record compiler warnings and static analysis results) tool – checkstyle – report file pattern – checkstyle-result.xml- apply – save.

 

Step 11: Continuous Testing – Run tests and publish Junit test report

 

 Install Junit Realtime test reporter plugin

 

Manage jenkins – manage plugins – JUnit Realtime Test Reporter – install without restart. 

 

Dashboard – new item – unittest – freestyle -ok

 

General – advanced – Use custom workspace ${JENKINS_HOME}/workspace/webapp

 

source code management – git – paste the url of github.

 

build -Add buit step – Invoke Ant – Target – junit

 

Post build Action – publish Junit test Result report- test report XML’s – TestCalculator_JUnitResul.xml – apply – save.

 

If required modify port and user privileges-

c:\programefiles\apache software foundation – conf – server (open with notpad++) modify it

 

line69-

port=8090

save it

 

open – tomcat-user.xml(with notepad++)

line22

<user username=”admin” password=”111″ roles=”manager-gui,manager-script,admin”>

save it.

 

restart system/tomcat.

 

Step 12: Continuos Deployment -Deploy code to production

 

Install “deploy to container” plugins -restart without restart.

 

new item – deploy – freestyle – ok

 

General- Advance – use custome workspace – ${JENKINS_HOME}/workspace/webapp

 

git – paste the url of github.

 

Build -Add build step – Invoke Ant, target – war

 

Post Build Action – deploy war/ear to container(war/ear file) “**/*.war” 

context path – webapp

now-add container – Tomcat 9.0(tomcat version)

credentials -add- admin- password-111,select tomcat url http://localhost:8090 – Apply – save

 

Stop and Start tomcat9 application

 

open webbroswer

http://localhost:8090

http://localhost:8090/jenkins

For Free, Demo classes Call: 02071177392
Registration Link: Click Here!

 

Step 13: CICD Build Pipleline

 

Install “Build Pipeline” plugins

 

go to githubpull – configure – postbuild action -build other project – buildandcodereview -save.

 

go to buildandcodereview – configure – post build action – build other project – unittest -save

 

go to unittest – configure – post build action – deploy – save.

 

Step 15. Restart Tomcat

Login again into jenkins- Dashboard – “+” new option – View name – complete Pipeline – select “Build Pipeline View – ok/create.

 

now – Upstream/downstream – Select Initial job – githubpull – apply – ok.

 

Dashboard – go to githubpull – configure – Build Triggers – Poll SCM 

 

– apply – save – Dashboard.

Now every minute code pull and run pipeline automatically, if you push update code in git hub then it will automatically deploy in web application through pipeline.

Author:

Abhijeet Dahatonde

SevenMentor Pvt Ltd.

Call the Trainer and Book your free demo Class for now!!!

call icon© Copyright 2020 | Sevenmentor Pvt Ltd.

Submit Comment

Your email address will not be published.

*
*