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

DevOps CICD Project Overview Guide

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)
52 views9 pages

DevOps CICD Project Overview Guide

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

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—[Link]--/var/www/html/[Link]

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

[Link]
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: [Link] [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—[Link] 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

[Link]-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/[Link]

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:

Common questions

Powered by AI

When implementing Jenkins pipelines, teams might face challenges such as managing pipeline complexity, ensuring plugin compatibility, and handling script syntax errors. To address these, teams can leverage declarative pipelines for a more structured and readable definition of their pipeline stages, reducing complexity. Regularly updating plugins and Jenkins itself can mitigate compatibility issues, while thorough testing and the use of pipeline libraries can help manage scripting challenges. Additionally, maintaining proper documentation and adopting version control for pipeline code are essential practices that help streamline these processes .

Docker containers improve the deployment process in DevOps by encapsulating an application along with its dependencies, creating a consistent environment across different stages of the deployment process. Unlike traditional methods that might require specific configurations on each server, Docker containers ensure that the application runs the same regardless of the host environment. This consistency reduces deployment errors, speeds up the deployment cycle, and lowers resource usage through efficient container management, aligning well with the agile practices promoted by DevOps .

SonarQube enhances code quality in the software development life cycle by providing static code analysis that identifies vulnerabilities, bugs, and code duplications. It assists developers by highlighting issues early in the development process, ensuring code adheres to quality gates and profiles before moving to further stages. Continuous integration with tools like Jenkins ensures that these checks are automated, allowing teams to maintain high code quality consistently as part of the CI/CD process. Such proactive identification and resolution of deficiencies lead to more robust and maintainable software .

Jenkins facilitates the connection between various tools in a DevOps pipeline through its plugin architecture and pipeline functionality. It acts as a central hub where different DevOps tools converge. For example, Jenkins can use plugins to integrate with Git for version control, Maven for building, Docker for containerization, and SonarQube for static code analysis. This connectivity ensures that each tool in the pipeline is utilized effectively, enabling a seamless flow of actions from code commit to deployment .

A private repository like Nexus in a DevOps environment serves as a centralized storage for build artifacts, allowing secure and efficient management of software components. Unlike public repositories, where access is open and security may be minimal, private repositories offer better control over access, ensuring only authorized users can push or pull artifacts. This makes it ideal for proprietary software or organizational security policies. Nexus also supports versioning and dependency management, which are critical for maintaining consistency across different environments .

The concept of branching strategy in Git enhances collaborative software development by allowing multiple developers to work on different features or bug fixes concurrently without affecting the main codebase. Branching strategies such as Git Flow, Feature Branching, or Trunk-based Development provide structured approaches where teams can merge their changes systematically through pull requests. This not only reduces integration conflicts but also facilitates continuous integration and delivery practices by keeping the master branch in a deployable state .

Trivy provides significant advantages when integrated into a Jenkins-based CI/CD pipeline by offering comprehensive security scanning of containers for vulnerabilities. It scans both the operating system and application dependencies, ensuring that open-source components do not introduce weaknesses into the software. Since Trivy can be automated within Jenkins jobs, it allows for real-time vulnerability assessments every time new containers are built, which is crucial for maintaining security compliance in a continuous deployment environment .

Maven lifecycles contribute to efficient build processes by automating and structuring several important phases such as validation, compilation, testing, packaging, and deployment. Each lifecycle phase ensures critical steps are completed in a sequential order. For instance, running the 'mvn package' command not only creates a distributable format but also automatically performs validation, compilation, and testing, ensuring a comprehensive build process. This automation reduces human error and increases the reliability and speed of the build process .

DevOps integrates development and operations by facilitating streamlined processes through CI/CD pipelines, which automate the steps involved in software deployment. Continuous Integration (CI) involves integrating code changes into a shared repository frequently, then automatically running tests to ensure code quality. Continuous Deployment (CD) extends this by automating the delivery of software updates to production environments. Key tools like Jenkins, Docker, and Maven allow for such automation, enabling faster and more reliable software deployments. This integration reduces friction between development and operations teams and increases overall deployment efficiency .

In the context of DevOps, operating an application involves running and maintaining it in the live environment, including user authentication, transaction processing, and performance monitoring. Testing, on the other hand, focuses on debugging and troubleshooting the source code before deployment. Testing aims to ensure the application meets quality standards by executing different test phases, while operating focuses on ensuring the application functions smoothly for end-users post-deployment .

You might also like