0% found this document useful (0 votes)
15 views17 pages

Cloud project ( Jenkins)- Racha ben arous (M2 Data Science)

The document outlines the steps for setting up an automated CI/CD pipeline using Jenkins, Maven, GitLab, and Tomcat. It details five phases: Basic Setup, Tool Configuration, Security and Keys, Pipeline Setup, and Deployment and Updates, including specific commands and configurations needed for each phase. The final steps involve modifying the project in GitLab, re-running the pipeline, and verifying the changes in the application.

Uploaded by

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

Cloud project ( Jenkins)- Racha ben arous (M2 Data Science)

The document outlines the steps for setting up an automated CI/CD pipeline using Jenkins, Maven, GitLab, and Tomcat. It details five phases: Basic Setup, Tool Configuration, Security and Keys, Pipeline Setup, and Deployment and Updates, including specific commands and configurations needed for each phase. The final steps involve modifying the project in GitLab, re-running the pipeline, and verifying the changes in the application.

Uploaded by

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

CLOUD PROJECT:

AUTOMATED CI/CD PIPELINE WITH JENKINS, MAVEN, GITLAB, AND TOMCAT

CREATED BY: RACHA BEN AROUS


M2 DATA SCIENCE

MAIL: RASHA.BENAROUS@GMAIL.COM
ROADMAP OF NECESSARY STEPS

5
1 2 4
3 PHASE 5: DEPLOYMENT
PHASE 1: BASIC PHASE 2: TOOL PHASE 3: SECURITY PHASE 4: AND UPDATES
SETUP CONFIGURATION AND KEYS PIPELINE SETUP 1. Access the Tomcat interface.
2. Modify the project via GitLab.
1. Change the machine hostname.
1. Add required plugins in 1. Create the Jenkins 3. Re-run the pipeline to build and
2. Install OpenJDK (Java). 1. Generate a public key
Jenkins. pipeline for deployment deploy the project.
3. Install Maven for build and add it to GitLab.
2. Identify and configure (with Maven and 4. Verify the implemented changes.
management. 2. Add the private key to
Tomcat and GitLab. Tomcat).
4. Install and configure Jenkins. Jenkins.
1
PHASE 1: BASIC SETUP

1/CHANGE THE MACHINE HOSTNAME:

sudo hostnamectl set-hostname jenkins

Why?
To clearly identify the machine as the Jenkins server in the network.
1
PHASE 1: BASIC SETUP

2/INSTALLING OPENJDK 17

sudo apt update


sudo apt install openjdk-17-jdk -y
Verification

java -version

Why?
Jenkins requires Java to run.
1
PHASE 1: BASIC SETUP

3/INSTALLING AND CONFIGURING MAVEN

sudo apt update


sudo apt install maven -y
Verify the
installation
mvn -version

Why?
Maven is used to automate builds, manage dependencies, and package Java projects.
1
PHASE 1: BASIC SETUP

3/INSTALLING AND CONFIGURING JENKINS

sudo apt update


sudo apt install jenkins -y
Install and Start
Jenkins
sudo systemctl start jenkins
1
PHASE 1: BASIC SETUP

3/INSTALLING AND CONFIGURING JENKINS

Access Jenkins in a browser:

http://13.53.38.185:8080
1
PHASE 1: BASIC SETUP

3/INSTALLING AND CONFIGURING JENKINS

Unlock Jenkins with the initial password:

sudo cat /var/lib/jenkins/secrets/initialAdminPassword


2 PHASE 2: TOOL CONFIGURATION

ADD REQUIRED PLUGINS IN JENKINS.

INSTALL THE FOLLOWING PLUGINS VIA THE JENKINS INTERFACE:


GITLAB PLUGIN
MAVEN INTEGRATION
PIPELINE

WHY?
THESE PLUGINS ENABLE GITLAB INTEGRATION, MAVEN BUILDS, AND PIPELINE MANAGEMENT.
2 PHASE 2: TOOL CONFIGURATION
IDENTIFY AND CONFIGURE TOMCAT AND GITLAB.

CONFIGURE JENKINS TO RECOGNIZE:


TOMCAT: ADD DEPLOYMENT CONFIGURATIONS.
GITLAB: ADD SSH CREDENTIALS TO ACCESS THE REPOSITORY.
3 PHASE 3: SECURITY AND KEYS

1. GENERATE A PUBLIC KEY AND ADD IT TO GITLAB.

1. Generate a public key for Jenkins: 2. Add the public key to GitLab under:

Settings > SSH Keys


3 PHASE 3: SECURITY AND KEYS

2. GENERATING THE PRIVATE KEY.

1. Add the private key in Jenkins:

MANAGE JENKINS > CREDENTIALS > ADD CREDENTIALS


4 PHASE 4: PIPELINE SETUP

1. CREATE THE JENKINS PIPELINE FOR DEPLOYMENT (WITH MAVEN AND TOMCAT)

pipeline {
Adding Pipeline Configurations agent any
stages {
stage('Clone') {
steps {
git 'https://gitlab.com/<repo>'
}
}
stage('Build') {
It’s just an example steps {
sh 'mvn clean install'
}
}
stage('Deploy') {
steps {
sh 'scp target/*.war tomcat@<server>:<path>'
}
}
}
}
5 PHASE 5: DEPLOYMENT AND UPDATES

1. ACCESS THE TOMCAT INTERFACE


5 PHASE 5: DEPLOYMENT AND UPDATES

2. MODIFY THE PROJECT VIA GITLAB


1. Edit the project content (e.g., change the displayed name on a webpage).
2. Commit the changes.
5 PHASE 5: DEPLOYMENT AND UPDATES

3. RE-RUN THE PIPELINE TO BUILD AND DEPLOY THE PROJECT

Re-run the Jenkins pipeline to:


Build the project with Maven.
Deploy the updates to Tomcat.
5 PHASE 5: DEPLOYMENT AND UPDATES

4. VERIFY THE IMPLEMENTED CHANGES.


Access the application via the browser to check for updates.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy