0% found this document useful (0 votes)
69 views9 pages

Devops Project

The document outlines a DevOps project focused on CI/CD using tools like Jenkins, Docker, and Maven, detailing the development and operational processes involved. It explains the roles of various components such as testing, deployment, and monitoring, as well as the implementation of a software delivery pipeline. Additionally, it covers the setup and configuration of essential tools like Sonarqube and Nexus, along with commands for managing Docker containers.

Uploaded by

zakkiya1318
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views9 pages

Devops Project

The document outlines a DevOps project focused on CI/CD using tools like Jenkins, Docker, and Maven, detailing the development and operational processes involved. It explains the roles of various components such as testing, deployment, and monitoring, as well as the implementation of a software delivery pipeline. Additionally, it covers the setup and configuration of essential tools like Sonarqube and Nexus, along with commands for managing Docker containers.

Uploaded by

zakkiya1318
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Project overview 2024

Zakkiya Thasneem

Devops – CICD Project

|
Devops = Development + Operations

Application [App]--mobile [iOS, android] --Browse [Edge, Google]

Swiggy- Food, India, invest, resource

Development: Developers & Testing team

Code: instructions—Piece of paper—100 lines

Build: Executable

Test: Check

Operations—Browser—Appstore\iStore—end user

Release—version –instamart\genie\food\cod\UPI

Deploy—place where you will work—index.html--/var/www/html/index.html

Operate: username/password—credit card\ UPI\food order

Difference between operate and testing

Testing will just debug and trouble shoot the source code where as operate is running and working in
the application

Monitor—efficiency

Devops tools: 5 special points about all tools

Release—Source code—

Continuous integration—Jenkins

Containers—docker

https://digital.ai/learn/devsecops.periodic.table/
CICD: Continuous integration and continuous deployment/delivery (interview question)

Testing—unit testing/integration/acceptance/functionality

Environment: Set of servers [5 EC2 instance—Amazon Linux-LB-ASG ]

Dev: set of servers

Test

QA

UAT/CAT

Prod: play store/Appstore—swiggy


Implementation of project:

GIT, Jenkins & Docker

Maven, Sonarqube, trivy & nexus

Pipeline: Connection between one tool to another

Jenkins

GIT fork – Use case

Git fetch vs git pull

How to resolve merge conflicts

Branching strategy

Git pull

Git rebase

Git cherry pick

Application: https://github.com/VM2322/Gaming [Fork it}

Servers: 4gb ram

1 EC2—Jenkins, docker, trivy[scan]

1 EC2—Sonarqube

1ec2—nexus

Jenkins port no: 8080

Plugins used: Stage view, JDK17, mavern, sonarqube, eclipse, Docker


plugins to install:

maven integration

config file

pipeline maven integration

sonarqube scanner

docker
pipeline

docker API

ecclipse temurin installer

default path for jenkins: cd/var/lib/jenkins/worksapce

Jenkins

Create a job-Dashboard-gaming-config (declarative pipeline) copy paste URL from git gaming repo

Changing URL/apply and save----build now/console output/ add plugin—stage view (install)

Reload job

Maven(build tool)—3stages—pom.xml file—


Apache product-- only java builder

Maven life cycle used- Compile/test/deploy

Phases:

The lifecycle consists of multiple phases, each representing a specific stage in the build
process. Some common phases include:

 Validate: Checks project structure and dependencies.


 Compile: Compiles source code (e.g., Java to bytecode).
 Test: Executes unit tests to verify code functionality.
 Package: Creates a distributable artifact (JAR, WAR, etc.).
 Install: Installs the artifact into a local repository.

Lifecycles:

Maven provides three built-in lifecycles:

 default (or build): The primary lifecycle for building and deploying the application.
 clean: Removes generated artifacts from previous builds.
 site: Generates project documentation and reports.

Goals and Plugins:

 Goals: Represent specific actions within a phase. Goals are typically provided by
Maven plugins.
 Plugins: Packages that contain one or more goals and contribute to building and
managing the project.
Execution Flow:

By default, Maven phases are executed sequentially. When you initiate a specific phase,
Maven automatically executes all preceding phases as well.

For instance, running the mvn package command triggers the default lifecycle, which
includes phases like validation, compilation, testing, and finally, package creation.

Tools to be installed:
1 Mavern installation:

Dashboard--Manage Jenkins—tools—JDK17

Jdk17-add jdk17- add jdk17- version: JDK-17.0.9+9

2 Mavern installation-mavern3—install automatically-3.9.7

Docker-- install automatically—version latest

3 Sonarqube

Sonarqube scanner-- install automatically--5.0.0.2996

SONARQUBE: Static Code Analysis

Code-checks-vulnerability, bugs, duplication.

SONARQUBE SCANNER [plugin]—jenkins

Quality gate

Quality profile

Default port number: 9000

NEXUS: Artifactory—Private repository

Create own repo – dockerhub—Ip address

Dockerhub.com-100%

Repository – custom –naming

Default port number-8091

TRIVY: scanning – server side—jenkins server


JENKINS

Pipeline: A pipeline is a set of automated steps that allow you to define your software delivery
process. It's a way to model, automate, and visualize your software delivery pipeline as code.
pipelines enable you to define your entire build, test, and deployment process in a single, version-
controlled file.

There are two main types of pipelines in Jenkins:

1. Scripted Pipeline: This type of pipeline is written in Groovy script. It provides full
flexibility and control over the flow of your pipeline but requires more scripting
knowledge and expertise.
2. Declarative Pipeline: This type of pipeline provides a simpler and more structured
way to define pipelines using a domain-specific language (DSL). It's designed to be
easier to read, write, and maintain, especially for beginners, as it abstracts away much
of the complexity of Groovy scripting.’

Set of commands used:

Ubuntu

sudo -i

sudo apt update

java

sudo apt install 17

vi <filename>

copy paste from jenkins site -y

ll - long list

chmod +x <filename>- to set execute permission

./ <filename>- To run

start jenkins copy paste from jenkins site

Check status

----------------------------------------------------------------------------------------------
sudo chmod 666 /var/run/docker.sock

command to create container in docker for sonarcube:

docker run -d --name sonar -p 9000:9000 sonarqube:lts-community

command to create container in docker for nexus:

docker run -d --name nexus -p 8081:8081 sonatype/nexus3:latest

command to get into the docker container

docker exec -it containerid /bin/bash

Final output:

You might also like