Skip to content

srinfotechbatch2/SRInfoTechAWSDevOpsTrainingNote

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 

Repository files navigation

SRInfoTechAWSDevOpsTrainingNote

08/06/2025_Demo::

In Demo session we have Overview the all CI/CD tools

image

13/06/2025_Tools Overview::

  1. Overview about the all CI/CD & AWSDevOps Training flow
  2. Discussed about the all the DevOps roles

DevOps::

DevOps is a software development and operations (DevOps) methodology that combines these two to improve efficiency and speed up project deliverables, It's very important because it helps businesses/deliver software faster and with higher quality.

What is the key purpose of DevOps? The primary goal of DevOps is to bridge the gap between development and operations teams. It creates a streamlined, efficient workflow that delivers software faster and with higher quality. DevOps is a set of practices,tools that automate and integrate the processes between software development and IT teams.

Devops engineer is a key role responsibility::

image

1)The devops engineer was responsibility to release the product to the market as soon as possible 2) release the product speed to the market 3)Devops engineer was give continues feedback to the developers 4) Devops engineer responsibility start from git and end with production

Benefits of DevOps ::

• Faster software delivery: Reduces lead times and speeds up the software delivery process • Higher software quality: Addresses bugs quicker and improves software quality • Better collaboration: Unifies development and operations teams, enhancing collaboration and efficiency • Competitive advantage: Creates a more nimble software development lifecycle that gives businesses an advantage over their competitors

13/06/2025::

What is Git?

Git is a free, open-source version control system (VCS) that helps developers manage their code. It's the most widely used tool VCS(version control system) Git is fast for committing, branching, merging, and comparing past versions Git is very high Performance and Flexibility,Security.

Integrate Git & Github::

image

Install Git in you local machine::

https://git-scm.com/downloads/win

Please download the ---64-bit Git for Windows Setup.

Once download the git .exe file , double click and install the git on your machine

once installed right click on your local machine you can found Open Git batch here option, means git is installed successfully in your machine.

image

GitHub account creation::

For creating github account EmailId is Required

go to link --https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F&source=header-home

Enter Email & password ,Username click continue ---Account will create successfully image

image

image

Github::Github is a one of the SCM(Source code management) tool and store the Project code.

Repository: storage area of your source code. Create a Repository on GitHub

click Repositories

image

Click New

image

Enter Repository Name::SRINFOTECHDEMO

image

Public:: Anyone on the internet can see this repository.

image

Private:: You choose who can see and commit to this repository.

select Add a README file

image

Click Create Repository

image

Repository Created SUccessfully with Default branch main

image

Github Introduction::

GitHub is a web-based platform for version control and collaboration, allowing developers to store and manage their code in repositories.

Version Control: :: GitHub uses Git, a distributed version control system, to track changes in code. This allows multiple people to work on the same project without overwriting each other's contributions.

Repositories::: where you can store your project files and track the history of changes made to those files.Public and private repos can be created depending on accessibility needs.

16/06/2025::

Git & Github Integration::

git and github communication happend via SSH keys

image

Generate SSHKeys::

open gitbash and run the below command

image

syntax::ssh-keygen -t ed25519 -C "your_email@example.com"

ssh-keygen -t ed25519 -C "srinfotechbatch2@gmail.com"

image

HP@DESKTOP-E518Q66 MINGW64 ~ $ ssh-keygen -t ed25519 -C "srinfotechbatch2@gmail.com" Generating public/private ed25519 key pair. Enter file in which to save the key (/c/Users/HP/.ssh/id_ed25519): /c/Users/HP/.ssh/id_ed25519 already exists. Overwrite (y/n)? y Enter passphrase for "/c/Users/HP/.ssh/id_ed25519" (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /c/Users/HP/.ssh/id_ed25519 Your public key has been saved in /c/Users/HP/.ssh/id_ed25519.pub The key fingerprint is: SHA256:CqROf7Z/FpbjGWy8/vMYGCS6Uq1ttFi/dKY2iAuBprg srinfotechbatch2@gmail.com The key's randomart image is: +--[ED25519 256]--+ | | | | | . . . | | + o o | | = o o So.. | |.= . + O oXo | |o . + B.+=+*+ | | . =.o..O=.o | |E oo.=+ooo. | +----[SHA256]-----+

Please follow below links for more understanding::

https://docs.github.com/en/authentication/connecting-to-github-with-ssh

https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent

Once genearted the keys (public/private) and copy public key to Github Account::

steps::

Your public key has been saved in /c/Users/HP/.ssh/id_ed25519.pub

image

right click and open id_ed25519.pub, and copy public key to Github Account

Go to -->Your Copilot OR settings, click your copilot

image

Click SSH and GPG Keys

image

click New SSH Key

image

Add new SSH Key and click Add SSH Key

image

ssh public key is added in github account

image

Clone repository/Project from github to local machine steps::

Fork::

Fork means to make a copy of the repository into my own github account A fork is a copy of a repository

first we need to create the repository

Go to Repositories

image

Click New

image

Enter Repository Name

image

select public

select Readmefile.md

image

Click Create Repository

Empty repository Created

image

Now I'm Going to clone the Empty Repository from Remote to Local::

Steps::

1.git clone git@github.com:srinfotechbatch2/SRINfotechDemo.git

2.cd SRINfotechDemo

3.git status

4.git add --all

5.git status

6.git commit -m "i have added hellow world project files"

7.git push ---->from local changes pushed to remote

8.git pull --->remote to local

above steps to push some changes from Local to remote repository

Create New Branch::

image

Go to Repositories

Click Branch

image

Click New Branch

image

New feature Branch Formate----> feature/YYYY.MM.DD

feature/2025.06.22

image

Branch Created Successfully

image

once branch created in github , we need to pull the new branch from Remote to Local

git pull

HP@DESKTOP-E518Q66 MINGW64 ~/OneDrive/Documents/SR InfoTech/AWS DevOps/SRINfotechDemo (main) $ git pull From github.com:srinfotechbatch2/SRINfotechDemo

  • [new branch] feature/2025.06.22 -> origin/feature/2025.06.22 Already up to date.

Switch one branch to another branch using git checkout command

git checkout

git checkout feature/2025.06.22

HP@DESKTOP-E518Q66 MINGW64 ~/OneDrive/Documents/SR InfoTech/AWS DevOps/SRINfotechDemo (main) $ git checkout feature/2025.06.22 branch 'feature/2025.06.22' set up to track 'origin/feature/2025.06.22'. Switched to a new branch 'feature/2025.06.22'

please make some changes in source code like Jenkinsfile and try to push changes to github repository, please follow below steps

1.git status

2.git add --all

3.git status

4.git commit -m "i have added hellow world project files"

5.git push

Lab Practice::

HP@DESKTOP-E518Q66 MINGW64 ~/OneDrive/Documents/SR InfoTech/AWS DevOps $ git clone git@github.com:srinfotechbatch2/SRINfotechDemo.git Cloning into 'SRINfotechDemo'... The authenticity of host 'github.com (20.207.73.82)' can't be established. ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU. This key is not known by any other names. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added 'github.com' (ED25519) to the list of known hosts. remote: Enumerating objects: 3, done. remote: Counting objects: 100% (3/3), done. remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0) Receiving objects: 100% (3/3), done.

HP@DESKTOP-E518Q66 MINGW64 ~/OneDrive/Documents/SR InfoTech/AWS DevOps $ cd SRINfotechDemo/

HP@DESKTOP-E518Q66 MINGW64 ~/OneDrive/Documents/SR InfoTech/AWS DevOps/SRINfotechDemo (main) $ git status On branch main Your branch is up to date with 'origin/main'.

Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: README.md

Untracked files: (use "git add ..." to include in what will be committed) .gitignore .whitesource Jenkinsfile pom.xml src/

no changes added to commit (use "git add" and/or "git commit -a")

HP@DESKTOP-E518Q66 MINGW64 ~/OneDrive/Documents/SR InfoTech/AWS DevOps/SRINfotechDemo (main) $ git add --all warning: in the working copy of 'README.md', LF will be replaced by CRLF the next time Git touches it warning: in the working copy of '.gitignore', LF will be replaced by CRLF the next time Git touches it warning: in the working copy of '.whitesource', LF will be replaced by CRLF the next time Git touches it warning: in the working copy of 'Jenkinsfile', LF will be replaced by CRLF the next time Git touches it warning: in the working copy of 'pom.xml', LF will be replaced by CRLF the next time Git touches it warning: in the working copy of 'src/main/java/hello/Greeter.java', LF will be replaced by CRLF the next time G it touches it warning: in the working copy of 'src/main/java/hello/HelloWorld.java', LF will be replaced by CRLF the next tim e Git touches it

HP@DESKTOP-E518Q66 MINGW64 ~/OneDrive/Documents/SR InfoTech/AWS DevOps/SRINfotechDemo (main) $ git status On branch main Your branch is up to date with 'origin/main'.

Changes to be committed: (use "git restore --staged ..." to unstage) new file: .gitignore new file: .whitesource new file: Jenkinsfile modified: README.md new file: pom.xml new file: src/main/java/hello/Greeter.java new file: src/main/java/hello/HelloWorld.java

HP@DESKTOP-E518Q66 MINGW64 ~/OneDrive/Documents/SR InfoTech/AWS DevOps/SRINfotechDemo (main) $ git commit -m "i have added hello world project files" [main 2f04570] i have added hello world project files 7 files changed, 367 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 .whitesource create mode 100644 Jenkinsfile create mode 100644 pom.xml create mode 100644 src/main/java/hello/Greeter.java create mode 100644 src/main/java/hello/HelloWorld.java

HP@DESKTOP-E518Q66 MINGW64 ~/OneDrive/Documents/SR InfoTech/AWS DevOps/SRINfotechDemo (main) $ git push Enumerating objects: 15, done. Counting objects: 100% (15/15), done. Delta compression using up to 4 threads Compressing objects: 100% (10/10), done. Writing objects: 100% (13/13), 5.42 KiB | 793.00 KiB/s, done. Total 13 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0) To github.com:srinfotechbatch2/SRINfotechDemo.git 03b032f..2f04570 main -> main

HP@DESKTOP-E518Q66 MINGW64 ~/OneDrive/Documents/SR InfoTech/AWS DevOps/SRINfotechDemo (main) $ git pull From github.com:srinfotechbatch2/SRINfotechDemo

  • [new branch] feature/2025.06.22 -> origin/feature/2025.06.22 Already up to date.

HP@DESKTOP-E518Q66 MINGW64 ~/OneDrive/Documents/SR InfoTech/AWS DevOps/SRINfotechDemo (main) $ git checkout feature/2025.06.22 branch 'feature/2025.06.22' set up to track 'origin/feature/2025.06.22'. Switched to a new branch 'feature/2025.06.22'

HP@DESKTOP-E518Q66 MINGW64 ~/OneDrive/Documents/SR InfoTech/AWS DevOps/SRINfotechDemo (feature/2025.06.22) $ git status On branch feature/2025.06.22 Your branch is up to date with 'origin/feature/2025.06.22'.

Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: Jenkinsfile

no changes added to commit (use "git add" and/or "git commit -a")

HP@DESKTOP-E518Q66 MINGW64 ~/OneDrive/Documents/SR InfoTech/AWS DevOps/SRINfotechDemo (feature/2025.06.22) $ git add --all warning: in the working copy of 'Jenkinsfile', LF will be replaced by CRLF the next time Git touches it

HP@DESKTOP-E518Q66 MINGW64 ~/OneDrive/Documents/SR InfoTech/AWS DevOps/SRINfotechDemo (feature/2025.06.22) $ git commit -m "modified jenkinsfile" [feature/2025.06.22 9bb0cbe] modified jenkinsfile 1 file changed, 13 deletions(-)

HP@DESKTOP-E518Q66 MINGW64 ~/OneDrive/Documents/SR InfoTech/AWS DevOps/SRINfotechDemo (feature/2025.06.22) $ git push Enumerating objects: 5, done. Counting objects: 100% (5/5), done. Delta compression using up to 4 threads Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 290 bytes | 145.00 KiB/s, done. Total 3 (delta 2), reused 0 (delta 0), pack-reused 0 (from 0) remote: Resolving deltas: 100% (2/2), completed with 2 local objects. To github.com:srinfotechbatch2/SRINfotechDemo.git 2f04570..9bb0cbe feature/2025.06.22 -> feature/2025.06.22

HP@DESKTOP-E518Q66 MINGW64 ~/OneDrive/Documents/SR InfoTech/AWS DevOps/SRINfotechDemo (feature/2025.06.22) $ git status On branch feature/2025.06.22 Your branch is up to date with 'origin/feature/2025.06.22'.

Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: Jenkinsfile

no changes added to commit (use "git add" and/or "git commit -a")

HP@DESKTOP-E518Q66 MINGW64 ~/OneDrive/Documents/SR InfoTech/AWS DevOps/SRINfotechDemo (feature/2025.06.22) $ git add --all warning: in the working copy of 'Jenkinsfile', LF will be replaced by CRLF the next time Git touches it

HP@DESKTOP-E518Q66 MINGW64 ~/OneDrive/Documents/SR InfoTech/AWS DevOps/SRINfotechDemo (feature/2025.06.22) $ git commit -m "modified jenkinsfile" [feature/2025.06.22 aff43d0] modified jenkinsfile 1 file changed, 13 insertions(+)

HP@DESKTOP-E518Q66 MINGW64 ~/OneDrive/Documents/SR InfoTech/AWS DevOps/SRINfotechDemo (feature/2025.06.22) $ git push Enumerating objects: 5, done. Counting objects: 100% (5/5), done. Delta compression using up to 4 threads Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 527 bytes | 263.00 KiB/s, done. Total 3 (delta 1), reused 0 (delta 0), pack-reused 0 (from 0) remote: Resolving deltas: 100% (1/1), completed with 1 local object. To github.com:srinfotechbatch2/SRINfotechDemo.git 9bb0cbe..aff43d0 feature/2025.06.22 -> feature/2025.06.22

HP@DESKTOP-E518Q66 MINGW64 ~/OneDrive/Documents/SR InfoTech/AWS DevOps/SRINfotechDemo (feature/2025.06.22) $ git status On branch feature/2025.06.22 Your branch is up to date with 'origin/feature/2025.06.22'.

Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: Jenkinsfile

no changes added to commit (use "git add" and/or "git commit -a")

HP@DESKTOP-E518Q66 MINGW64 ~/OneDrive/Documents/SR InfoTech/AWS DevOps/SRINfotechDemo (feature/2025.06.22) $ git add --all warning: in the working copy of 'Jenkinsfile', LF will be replaced by CRLF the next time Git touches it

HP@DESKTOP-E518Q66 MINGW64 ~/OneDrive/Documents/SR InfoTech/AWS DevOps/SRINfotechDemo (feature/2025.06.22) $ git status On branch feature/2025.06.22 Your branch is up to date with 'origin/feature/2025.06.22'.

Changes to be committed: (use "git restore --staged ..." to unstage) modified: Jenkinsfile

HP@DESKTOP-E518Q66 MINGW64 ~/OneDrive/Documents/SR InfoTech/AWS DevOps/SRINfotechDemo (feature/2025.06.22) $ git commit -m "modified jenkinsfile" [feature/2025.06.22 41147f7] modified jenkinsfile 1 file changed, 1 insertion(+), 12 deletions(-)

HP@DESKTOP-E518Q66 MINGW64 ~/OneDrive/Documents/SR InfoTech/AWS DevOps/SRINfotechDemo (feature/2025.06.22) $ git push Enumerating objects: 5, done. Counting objects: 100% (5/5), done. Delta compression using up to 4 threads Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 291 bytes | 291.00 KiB/s, done. Total 3 (delta 2), reused 0 (delta 0), pack-reused 0 (from 0) remote: Resolving deltas: 100% (2/2), completed with 2 local objects. To github.com:srinfotechbatch2/SRINfotechDemo.git aff43d0..41147f7 feature/2025.06.22 -> feature/2025.06.22

17/06/2025::

Github Branching Model::

A GitHub branching model is a structured way of organizing branches in a Git repository to manage development workflows effectively. It helps teams work collaboratively, isolate features, manage releases, and deploy code more efficiently.

image

Sample Repository Hello-World Project::

https://github.com/srinfotechbatch2/SRINfotechDemo

Branches:

main (or master): Always production-ready.

feature/*: Used for new features.

release/*: Prepares for a new production release.

main or master branch:: This is default branch and whenever we created the empty Repository by defauly main or master branche is created automatically. main or master branch always stable and live code

feature branch:: It could be a new feature, an improvement of existing features, bug fixes, or any other changes. A feature branch is a type of branch in Git typically used to develop new features for the software.feature branch will created from main or master OR feature branch created from latest release branch always based on the release cycle

formate:: feature/YYYY.MM.DD feature/2025.06.22

release branch:: Based on the release we have created release branch accourdingly and starts the next release cycle. always release branch created from master only and master have stable and live code and post release we shold merged code changes to master branch only

release/2025.07.20

hotfix branch:: always created from main or master branch only for production fixes.once production fix done we should merged directly to main or master branch only.

always created this hotfix branch for production issues fixes

bugfix:: this branch is created from release branch to fix the LLE(lower level environemnt)/Pre-Prod/UAT/Non-Prod issues and once LLE issues fixed ,we should pushed their changes to release branch only.

Raise PR (Pull Request) ::

Merge the code from one branch to another branch that is called pull request

below are the steps to raise PR::

Go to -->Pull requests and click

image

Click New Pull Request::

image

Compare & pull Request

image

select base & compare options

image

Raise PR(Pull Request) from feature to release branch

image

please select base & compare branches so here base branch is release/2025.06.29 and compare branch is feature/2025.06.22

i'm going to merge code changes from feature branch to release branch

image

click create pull request

image

image

click merge request

confirm merge

image

merged 1 commit into release/2025.06.29 from feature/2025.06.22 Copied!

image

18/06/2025::

Avoide conflicts in RealTime Scenarious::

If multiple developers OR DevOps Engineers are working on same Project/MOdules, if they tried to commits thier code changes to Repository, it will faces the conflicts issues and how to resolved those conflicts issues in real time projects

image

git pull --->git pull command is use, copies changes from a remote repository directly into your working directory (local directory) and merged code changes from remote repository to local repository git fetch ---->The git fetch command only fetch the changes into your local Git repo and it will not merged anything. just fetch the details

Please create developer1,developer2,developer3 directories in your local machine and clone the project code separately

image

image

image

Editor steps for Resolved the conflicts::

resolved conflicts::

git pull

opend the editor

1.presh the i from your keyboard

2.esc

3.swift+:

4.wq

5.enter

Developer1 Activity::

git checkout feature/2025.02.27 error: pathspec 'feature/2025.02.27' did not match any file(s) known to git

HP@DESKTOP-E518Q66 MINGW64 ~/Desktop/A/spring-petclinic (main) $ git pull From github.com:parasa7358/spring-petclinic

  • [new branch] feature/2025.02.27 -> origin/feature/2025.02.27 Already up to date.

HP@DESKTOP-E518Q66 MINGW64 ~/Desktop/A/spring-petclinic (main) $ git checkout feature/2025.02.27 branch 'feature/2025.02.27' set up to track 'origin/feature/2025.02.27'. Switched to a new branch 'feature/2025.02.27'

HP@DESKTOP-E518Q66 MINGW64 ~/Desktop/A/spring-petclinic (feature/2025.02.27) $ git status On branch feature/2025.02.27 Your branch is up to date with 'origin/feature/2025.02.27'.

Untracked files: (use "git add ..." to include in what will be committed) Jenkinsfile

nothing added to commit but untracked files present (use "git add" to track)

HP@DESKTOP-E518Q66 MINGW64 ~/Desktop/A/spring-petclinic (feature/2025.02.27) $ git add --all warning: in the working copy of 'Jenkinsfile', LF will be replaced by CRLF the next time Git touches it

HP@DESKTOP-E518Q66 MINGW64 ~/Desktop/A/spring-petclinic (feature/2025.02.27) $ git status On branch feature/2025.02.27 Your branch is up to date with 'origin/feature/2025.02.27'.

Changes to be committed: (use "git restore --staged ..." to unstage) new file: Jenkinsfile

HP@DESKTOP-E518Q66 MINGW64 ~/Desktop/A/spring-petclinic (feature/2025.02.27) $ git commit -m "Added jenkins file for Feb Release" [feature/2025.02.27 9ad4ee0] Added jenkins file for Feb Release 1 file changed, 22 insertions(+) create mode 100644 Jenkinsfile

HP@DESKTOP-E518Q66 MINGW64 ~/Desktop/A/spring-petclinic (feature/2025.02.27) $ git push Enumerating objects: 4, done. Counting objects: 100% (4/4), done. Delta compression using up to 4 threads Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 483 bytes | 241.00 KiB/s, done. Total 3 (delta 1), reused 0 (delta 0), pack-reused 0 (from 0) remote: Resolving deltas: 100% (1/1), completed with 1 local object. To github.com:parasa7358/spring-petclinic.git e4b9aa2..9ad4ee0 feature/2025.02.27 -> feature/2025.02.27

Developer2 Activity::

HP@DESKTOP-E518Q66 MINGW64 ~/Desktop/B/spring-petclinic (feature/2025.02.27) $ git pull Already up to date.

HP@DESKTOP-E518Q66 MINGW64 ~/Desktop/B/spring-petclinic (feature/2025.02.27) $ git status On branch feature/2025.02.27 Your branch is ahead of 'origin/feature/2025.02.27' by 2 commits. (use "git push" to publish your local commits)

nothing to commit, working tree clean

HP@DESKTOP-E518Q66 MINGW64 ~/Desktop/B/spring-petclinic (feature/2025.02.27) $ git push Enumerating objects: 9, done. Counting objects: 100% (8/8), done. Delta compression using up to 4 threads Compressing objects: 100% (5/5), done. Writing objects: 100% (5/5), 586 bytes | 293.00 KiB/s, done. Total 5 (delta 3), reused 0 (delta 0), pack-reused 0 (from 0) remote: Resolving deltas: 100% (3/3), completed with 2 local objects. To github.com:parasa7358/spring-petclinic.git 9ad4ee0..ed57c5e feature/2025.02.27 -> feature/2025.02.27

Developer3 Activity::

HP@DESKTOP-E518Q66 MINGW64 ~/Desktop/C/spring-petclinic (feature/2025.02.27) $ git status On branch feature/2025.02.27 Your branch is ahead of 'origin/feature/2025.02.27' by 2 commits. (use "git push" to publish your local commits)

nothing to commit, working tree clean

HP@DESKTOP-E518Q66 MINGW64 ~/Desktop/C/spring-petclinic (feature/2025.02.27) $ git push Enumerating objects: 33, done. Counting objects: 100% (24/24), done. Delta compression using up to 4 threads Compressing objects: 100% (9/9), done. Writing objects: 100% (13/13), 1.14 KiB | 233.00 KiB/s, done. Total 13 (delta 5), reused 0 (delta 0), pack-reused 0 (from 0) remote: Resolving deltas: 100% (5/5), completed with 5 local objects. To github.com:parasa7358/spring-petclinic.git ed57c5e..80681f1 feature

Please be practice above 3 developers activity in real time bases

git fetch--->just fetch

git pull -->fetch+merged

Git All the Commands::

Git commands::

1.git clone git@github.com:srinfotechbatch2/SRINfotechDemo.git

2.cd SRINfotechDemo

3.git status

4.git add --all

5.git status

6.git commit -m "i have added hellow world project files"

7.git push ---->from local changes pushed to remote

8.git pull --->remote to local

9.git checkout

git checkout feature/2025.06.22

10.git pull --->every devlioper beforre pushing their changes we should make sure git pull the every time

clone Clone a repository into a new directory

add Add files

status Show the working tree status

commit Record changes to the repository

pull Fetch from and integrate with another repository or a local branch

push Update remote refs along with associated objects

19/06/2025::

1.install git 2.introcuction about git-->VCS 3.github-->SCM 4.introduction about github 5.github account 6.create repositories 7.integarte git & github via SSH keys--->ssh-keygen -t ed25519 8.how to created branch in github 9.how to rasie PR-->pull requests--->feature branch to release 10. git commands::

1.git clone 2.cd 3.git checkout 4.git status 5.git add -all 6.git commit 7.git push 8.git pull 9.git fetch 10.

git pull

opend the editor

1.presh the i from your keyboard 2.esc 3.swift+: 4.wq 5.enter

10.how to resolved the git conflicts 11.github branching model/stargety 12.end to end flow of git & github

Jenkins Introductiion::

Jenkins is a free and open source automation server/tool. It helps automate the parts of software development related to building, testing, and deploying, facilitating continuous integration and continuous delivery.

Jenkins is a Orchestration tool

Jenkins is a CI/CD tool

Jenkins is a Schedular

Jenkins is a crone job schedular

image

image

Roles And Responsibilities::

1)The devops engineer was responsibility to release the product to the market as soon as possible 2)release the product speed to the market 3)Devops engineer was give continues feedback to the developers 4) Devops engineer responsibility start from git and end with production

A) when your activity start from git and end with production environment(production servers)Continues deployment when your activity start from git to LLE(lower level environment,testing environment,pre-prod…et) environment(pre-production servers)Continues delivery non-production environment

Tutorials::

https://www.tutorialspoint.com/jenkins/jenkins_overview.htm https://www.geeksforgeeks.org/jenkins-tutorial/#prerequisites

Download JDK 17 ::

https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html

Windows x64 Installer 153.92 MB

Windows x64 Compressed Archive 172.87 MB https://download.oracle.com/java/17/archive/jdk-17.0.12_windows-x64_bin.zip (sha256 )

JDK 17 Environment setup::

Go to Search box & type Edit the system environemnt variables and click

It will navigate to System properties

image

Click Environment Variables

image

image

User variables::

image

Click New

Variable Name:: JAVA_HOME

Variable Value:: C:\Users\HP\Downloads\jdk-17.0.12_windows-x64_bin\jdk-17.0.12

image

Click OK

image

System variable::

image

Edit Path

image

Click New and give Java Installed path till \bin

C:\Users\HP\Downloads\jdk-17.0.12_windows-x64_bin\jdk-17.0.12\bin

image

Click OK

You Can verify Java is Installed Or Not

Go to command Prompt

image

image

java --version

C:\Users\HP>java --version java 17.0.12 2024-07-16 LTS Java(TM) SE Runtime Environment (build 17.0.12+8-LTS-286) Java HotSpot(TM) 64-Bit Server VM (build 17.0.12+8-LTS-286, mixed mode, sharing)

image

Above Screeenshot JDK17 setup is done

Installed jenkins in Windows::

https://www.jenkins.io/download/

Go to google search -->download jenkins war file for windows

click below Jenkins version

Download Jenkins 2.515 for:

image

Jenkins.war file is downloaded

image

20/06/2025::

MAven Environment setup::

Maven::

Maven is a powerful build automation tool used primarily for Java projects. Developed by the Apache.

it helps developers manage a project's build, dependencies, documentation, and more—all using a single configuration file called pom.xml

image

Common Maven Commands OR Maven Goals::

  1. mvn clean ------------> Deletes target/ directory (clean build).

  2. mvn compile -----------> Compiles the source code.

  3. mvn test ------------> Runs tests.

  4. mvn package ------------> Creates a JAR/WAR.

  5. mvn install ------------> Installs package into your local repository.

  6. mvn deploy -------------> Deploys package to a remote repository.

Maven Download link

https://maven.apache.org/download.cgi

Please download below zip file

Binary zip archive apache-maven-3.9.10-bin.zip

image

Downloaded Zip file

image

Please extract the file

image

Go to Search box & type Edit the system environemnt variables and click

It will navigate to System properties

image

Click Environment Variables

image

image

User variables::

image

Click New

Variable Name:: MAVEN_HOME

Variable Value:: C:\Users\HP\Downloads\apache-maven-3.9.10

image

Click OK

image

System variable::

image

Edit Path

![image](https://githubmvn -v.com/user-attachments/assets/5f302184-84cb-4e66-b17a-3ce4792fa45c)

Click New and give maven Installed path till \bin

C:\Users\HP\Downloads\apache-maven-3.9.10\bin

image

Click OK

image

You Can verify maven is Installed Or Not

Go to command Prompt

image

mvn -v

image

C:\Users\HP>mvn -v

Apache Maven 3.9.10 (5f519b97e944483d878815739f519b2eade0a91d) Maven home: C:\Users\HP\Downloads\apache-maven-3.9.10 Java version: 17.0.12, vendor: Oracle Corporation, runtime: C:\Users\HP\Downloads\jdk-17.0.12_windows-x64_bin\jdk-17.0.12 Default locale: en_IN, platform encoding: Cp1252 OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

image

Above Screeenshot maven setup is done

Installed jenkins in Windows::

Please follow the below link steps to installed jenkins in your windows machines

https://www.jenkins.io/doc/book/installing/war-file/

https://www.jenkins.io/download/

Go to google search -->download jenkins war file for windows

click below Jenkins version

Download Jenkins 2.515 for:

image

Jenkins.war file is downloaded

image

Steps::

https://www.jenkins.io/download/

  1. First download the jenkins.war file and right click -->open gitbash here

image

  1. run the command -->java -jar jenkins.war --httpPort=9090

image

image

we can see Jenkins is fully up and running

image

Browse to http://localhost:9090 and wait until the Unlock Jenkins page appears

Installed the default suggested plugins

image

click on continue

Need to create jenkins user profile

USER Name--->admin (any name you can provide)

PASSWORD -->admin (any password as your wish but make sure you should remembered the these credentials)

image

Steps::

1.first we need to create New repository in Github

2.please Clone the Empty Repositoy in your local system

3.copy the Spring-petclinic project code to in your repository

4.once done we need to push project code to github repository

  1. we need to integarte Github to Jenkins

we need to create Sample demo Project in Jenkins

Create sample Freestyle project::

Click New Item

image

Configuration stages::

1.General

2.Source code management (SCM)

3.Triggres

4.Environment

5.Build Steps

6.Post Build Actions

image

General Section provide the Project/job description

At SCM stage level select the Git and provide the github details

Below url is spring-petclinic Project and everyone Should please Fork to your github account

Github Project URL::

https://github.com/srinfotechbatch2/spring-petclinic

https://github.com/srinfotechbatch2/spring-petclinic.git

image

Branches to build

image

image

Build steps::select the Invoke top-level Maven targets Goals section

mvn clean install

Maven goals::

mvn test

mvn install

mvn clean install

mvn clean

mvn package

image

Job will be created

Click Build Now

Buils is Inprogress

image

Success Builds

image

23/06/2025::

Poll SCM ::Jenkins server ask git if there is any changes in git server or not, if changes there Jenkins server build/package the changes , every change build happened like 5 mints ,means every 5 minutes verify the Jenkins server to git if there is any changes

image

POLL SCM ----* * * * * --every minute when every commit

Chrone JObs Formate LInk::

https://crontab.guru/examples.html

Create one sample POLL SCM jenkins job::

Go to jenkins Dashboard click New Item

image

Description

image

Provide the Git URL

Onlinebookstore Project::

https://github.com/srinfotechbatch2/onlinebookstore.git

image

Branch buiild

image

POLL SCM:: * * * * *

every minute build was trigger when new commits happend in github repository

image

Build Steps::

Select Invoke top-level Maven targets

image

image

Once New Commits Happend in Github , Automatically Build is triggered in The Jenkins Server this Called CI (Continuous Integration)

Check Your Workspace::

once build success we can bale to see the /target folder under the Workspace

image

1.To check a job's workspace:

2.Navigate to the job in the Jenkins UI.

3.Click on "Workspace" in the left sidebar.

image

Under Target Folder we can able to see the all .ear/war/jar/zip Artifacts Formates

image

PLease try to execute the Project with below Maven Goals and see the difference

Common Maven Commands OR Maven Goals::

https://github.com/srinfotechbatch2/onlinebookstore.git

https://github.com/srinfotechbatch2/spring-petclinic.git

  1. mvn clean ------------> Deletes target/ directory (clean build).

  2. mvn compile -----------> Compiles the source code.

  3. mvn test ------------> Runs tests.

  4. mvn package ------------> Creates a JAR/WAR.

  5. mvn install ------------> Installs package into your local repository.

  6. mvn deploy -------------> Deploys package to a remote repository.

24/06/2025::

image

Poll SCM ::

Jenkins server ask git if there is any changes in git server or not, if changes there Jenkins server build/package the changes , every change build happened like 5 mints ,means every 5 minutes verify the Jenkins server to git if there is any changes

image

POLL SCM ----* * * * * --every minute when every commit

Build Periodically:::

H/15 * * * * ----this build happened every 5 minutes without commits ,if changes are commit or not but every 5 mints build happened in Jenkins

Please create a New Jenkins jobs both POLL SCM & Build Periodically

https://github.com/srinfotechbatch2/spring-petclinic.git https://github.com/srinfotechbatch2/onlinebookstore.git

Automatically Discard Old Builds:::

To automate the process of discarding old builds, you can configure the job’s settings to automatically delete old builds based on criteria such as the number of builds to keep or the age of the builds.

Follow these steps:

Open the Jenkins job (project). Click on Configure (on the left-hand side). Scroll down to the Build Discarder section (usually under the Build Triggers section). Check Discard old builds. Specify the following options: Max # of builds to keep: Set the maximum number of builds to keep. Max days to keep builds: Set the maximum age for builds to keep. Save the configuration by clicking Save.

image

Execute the Jobs in Parallel::

1.By Default execute the Jenkins build jobs are sequence way,one by one

2.Don’t do 2 projects build parallel this is real time scenario but we can do parallel builds as well one job

Jenkins build parallel setup

Go job ---> configure ----> Generall ---> Execute concurrent builds if necessary

image

image

Here 5 builds execute parallel ,I kept executor is 5 this is same machine

image

Build Periodically::: H/15 * * * * ----this build happened every 5 minutes without commits ,if changes are commit or not but every 5 mints build happened in Jenkins

Create Sample Build peridiocally jenkins job::

Description

image

Git url::

image

Build the branch

image

every 5 mints build will trigger

Build Periodically::: H/15 * * * * ----this build happened every 5 minutes without commits ,if changes are commit or not but every 5 mints build happened in Jenkins image

click save

25/06/2025::

Email Notifications::

1.Setting up Jenkins Email Notifications allows you to alert your team when a build passes, fails, or encounters issues. Here's a step-by-step guide to configure it

  1. give continues Feedback to the Dev team via Email when a build passes, fails

image

Steps::

Go to mail

image

Click manage your google account

image

Click Security

image

Click protect your account

image

Click Add phone number

image

Click add phone

image

image

image

Make sure your account is protected

image

Make sure 2-steps Verification is ON

image

Credentials:

In search box App Password

image

image

image

image

Zvqxxvplduhrlffv --we should provide this password in Jenkins Email configuration level

image

Go to Jenkins ---> Manage Jenkins

System configurations

image

Go to Extended E-mail Notification

image

SMTP server :: smtp.gmail.com

SMTP Port:: 465

Credentials:: Username:: Your Email Password::Zvqxxvplduhrlffv

image

Select Use SSL

Default content type HTML

image

Default Triggers

image

E-mail Notification

image

image

Use SMTP Authentication? –should selected

Use SSL select

Port 465

image

Test configuration by sending test e-mail

image

Connection success

image

Post build action

image

image

image

image

26/06/2025::

Published Artifacts & Test Results::

image

image

Post build Action i want to published artifacts & test results

image

I'm going to created one free style job and configured Post-build Actions

In post build Action select the option Archive the artifacts

target/.war OR target/.jar OR target/.zip OR target/.ear

image

image

In post build Action select the option Publish JUnit test result report for to published the test results

target/surefire-reports/*.xml

image

I want to show test results ::

ls target

Post build action stage

Select archive the artifact --target/*.jar

Junit test results:: --target/surefire-reports/*.xml

See test results & antifactory ::

image

3.For every company will do sequence build on one project this is recommended approach

General ---just descriptin

SCM

where is your project--github, bitbucket

Triggere

whenever code changes i want build the project given time

Environmant

--all about workspaces folders

Build Steps

dev team will tell which tool we are using in current project

Post Build

devops engineer is aim is given continue feedback to dev team via email notification

27/06/2025::

Parameterized Jenkins Jobs ::

Run the same job with different inputs without modifying the configuration manually

Go To New Item

image

Enter Job Name, Free style project and click ok

image

Enter the description

image

Select the option This project is parameterised

image

Click Add Parameter

image

Select optiions String parameter or choise parameter or boolean parameter you can select the ny options based on your requirement

image

select string parameter

image

Select Choise Parameter

image

choise parameter

image

Click Save

image

You Can observed this project is parameterized

image

Click Build with parameter

image

select deployment environment

image

select which versioj you want to deployment like tis you can configured real time parameterized project in jenkins

image

Click Build

image

image

I want Build a 3 projects ::

I want a build 3 projects ,one project build is success then it will start 2nd project & once 2nd project build is success then it will start 3rd Project, without manually interventions we need setup these 3 projects configurations.

image

30/06/2025::

I want Build a 3 projects ::

I want a build 3 projects ,one project build is success then it will start 2nd project & once 2nd project build is success then it will start 3rd Project, without manually interventions we need setup these 3 projects configurations.

image

image

Project-A, Projec -B, Projec - C

Once Project-A build is done, then it will start Project-B build and once Project-B build SUccess then it will start Project-C build ---for this we need to select Add post-build action and select "Build other projects" in drop down and provide Project-B details.

image

Projec A is (Downstream project is ---Projec B)

Projec B is (UP Stream project is ----Projec A)

Projec C is (downstream project of --Projec B)

i created 3 free style project in jenkins

Project-A ::

Github URL::: https://github.com/parasa7358/spring-petclinic.git

image

Post Build Action , select the option Build Other Project Project-B

image

Project -B ::

Github URL:::https://github.com/parasa7358/onlinebookstore.git

image

Post Build Action , select the option Build Other Project Project-C

image

Project-C::

Github URL:::https://github.com/srinfotechbatch2/devOpsWeb.git

Pipelines Introduction:::

A Jenkins pipeline is a series of automated steps or stages that define the process of continuous integration/continuous delivery (CI/CD) for your code. Jenkins, being a popular open-source automation server, uses pipelines to automate tasks like building, testing, and deploying code.

There are two types of Jenkins pipelines:

  1. Declarative Pipeline

  2. Scripted Pipeline

  3. Declarative Pipeline:: The declarative pipeline syntax is simpler and more structured. It's the recommended style for most users because it's easy to read and maintain

Create Pipeline Project::

Steps

Click +New Item

image

Enter the Project Name And Click OK

image

At General Section Provide the Description

image

At Definition, We need to select the Pipeline Script

image

Here's an example of a simple declarative pipeline: Syntax

pipeline{

agent any

stages{

Stage ('Clone'){

steps{

// write code } }

Stage ('Build'){ steps{

// write code } // write code

}

Stage ('Test'){

steps{

// write code } // write code

} Stage ('Execute test casea and get the results'){

steps{

// write code } // write code

}

Stage ('Generated Artifact'){

steps{

// write code } // write code

}

Stage ('Deploy'){

steps{

// write code } // write code

}

// write code

}

}

Please try to create one pipeline job in jenkinsfile and execute the below Declarative pipeline example:;

pipeline {

agent any

stages {
    stage('Clone') {
        steps {
            git branch: 'main', url: 'https://github.com/srinfotech7358/spring-petclinic.git'
        }
    }
    
      stage('Build') {
        steps {
           bat 'mvn clean install'
        }
    }
      stage('Test') {
        steps {
           bat 'mvn test'
        }
    }
      
}

}

Plugins::

Plugins in Jenkins are essential components that extend its core functionality, allowing you to customize Jenkins to meet specific CI/CD needs. Jenkins has a vast plugin ecosystem that supports building, deploying, and automating software projects across various platforms and tools

Install Plugins in Jenkins::

Step-by-Step: Log in to Jenkins as an administrator.

Navigate to Manage Jenkins (usually on the left sidebar).

Click on Manage Plugins.

(Image reference from Jenkins documentation)

Go to the Available tab.

Use the search box to find the plugin you want.

Check the box next to the plugin name.

Click:

Pipeline: Stage View::

Pipeline: Stage View Plugin in Jenkins The Pipeline: Stage View plugin is a visualization tool in Jenkins that allows users to see a graphical view of each stage in a pipeline. It provides a real-time and historical overview of pipeline execution per stage, making it easier to debug, monitor, and analyze performance.

Click the Build Now and we can triggered the pipeline

image

image

Success all the stages & Steps

image

Key elements in the declarative pipeline:::

pipeline: This is the top-level structure.

agent: Specifies where the pipeline will run, such as on any available agent, a specific node, or a Docker container.

stages: Defines the different steps or stages in the pipeline (e.g., Build, Test, Deploy).

steps: Commands to be executed in each stage.

02/07/2025::

Please try to create one pipeline job in jenkinsfile and execute the below Declarative pipeline example:;

pipeline {

agent any

stages { stage('Clone') { steps { git branch: 'main', url: 'https://github.com/srinfotech7358/spring-petclinic.git' } }

  stage('Build') {
    steps {
       bat 'mvn clean install'
    }
}
  stage('Test') {
    steps {
       bat 'mvn test'
    }
}

  stage('Generate Junit Test Results') {
    steps {
       junit 'target/surefire-reports/*.xml'
    }
}

  stage('Generate Artifacts') {
    steps {
       archiveArtifacts artifacts: 'target/*.war', followSymlinks: false
    }
}

} }

See test results & antifactory ::

archive the artifact :: target/*.jar

Junit test results:: target/surefire-reports/*.xml

image

Pipeline as Code::

Both declarative and scripted pipelines are stored as Jenkinsfiles, which you place in your source code repository. This allows you to version control your pipeline and keep it aligned with your application code.

image

image

03/07/2025::

Pipeline as Code::

Both declarative and scripted pipelines are stored as Jenkinsfiles, which you place in your source code repository. This allows you to version control your pipeline and keep it aligned with your application code.

Declarative pipeline with Jenkinsfile::

pipeline { agent any

stages {
    stage('Clone') {
        steps {
            git branch: 'main', url: 'git@github.com:parasa7358/spring-petclinic.git'
        }
    }
    stage('Build') {
        steps {
            sh 'mvn package'
        }
    }
    
    stage('Test') {
        steps {
            sh 'mvn test'
        }
    }
    stage('Test Results Reports') {
        steps {
            junit 'target/surefire-reports/*.xml'
        }
    }
    
    stage('Artifacts') {
        steps {
            archiveArtifacts artifacts: 'target/*.war', followSymlinks: false
        }
    }
    stage('Deploy') {
        steps {
            echo 'Hello World'
        }
    }
}

}

This pipeline:::

1 Checks out the source code from your Git repository.

  1. Builds the project using Maven.

3.Runs unit tests.

4.Deploys the application using a custom script.

JOb creation::

image

Branches to build

image

Script Path::: This path is Jenkinsfiles where we maintained in github source code level

image

Scripted pipeline with Jenkinsfile::

node{

stage('clone'){
    git branch: 'main', url: 'https://github.com/srinfotechbatch2/spring-petclinic.git'

}

 stage('build'){

    bat 'mvn clean install'
}

 stage('Test'){
  bat 'mvn test'
    
}
 stage('Artifacts'){
 archiveArtifacts artifacts: 'target/*.jar', followSymlinks: false
    
}
 stage('generated test reports'){
junit 'target/surefire-reports/*.xml'
    
}

}

image

github sourcecode jenkinsfile

image

Tomcat Web Server: Introduction

Apache Tomcat is an open-source web server and servlet container developed by the Apache Software Foundation. It is primarily used to serve Java applications and is one of the most popular servlet containers in the world.

Tomcat is an essential tool for anyone working with Java web applications. It provides a simple, reliable platform for deploying and managing Java Servlets and JSPs and is widely used in both development and production environments. Its ease of use, combined with powerful features and flexibility, makes it an ideal choice for many developers working on Java-based web applications.

Apache Tomcat is an open-source web server and servlet container that is primarily used to serve Java-based web applications. It implements several Java EE (Enterprise Edition) specifications, such as Java Servlet, JavaServer Pages (JSP), and WebSocket, among others. Tomcat is often used to run Java applications on the web because it's lightweight, easy to configure, and widely supported.

Here are some key points about Tomcat:

  1. Servlet Container: Tomcat is a servlet container, meaning it manages the lifecycle of Java Servlets, which are small Java programs that run on a web server.

  2. JSP Support: Tomcat also supports JavaServer Pages (JSP), a technology that allows for embedding Java code within HTML pages.

  3. Configuration: It’s highly configurable through XML files, like server.xml for server settings, web.xml for application settings, and others.

  4. Lightweight: Unlike full-fledged application servers like WildFly (formerly JBoss) or GlassFish, Tomcat is primarily a servlet and JSP container, which makes it lighter and easier to deploy for simpler Java web applications.

  5. Performance: It’s known for good performance in handling static content, making it a popular choice for Java web developers.

Integrate Tomcat with Jenkins::

image

04/07/2025::

Tomcat Download link::

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

64-bit Windows zip

image

Integrate Tomcat Jenkins::

image

image

Integrating Tomcat with Jenkins is a common use case for automating the deployment of Java-based web applications. Jenkins can be set up to deploy a web application to a Tomcat server whenever a new build is triggered.

Prerequisites:

Apache Tomcat should be installed and running on your server. Jenkins should be installed and running.

Steps to integrate Jenkins with Tomcat:

  1. Install the "Deploy to Container" Plugin in Jenkins: The easiest way to deploy to Tomcat from Jenkins is by using the Deploy to Container plugin. This plugin allows Jenkins to deploy WAR files to a Tomcat server.

Go to your Jenkins dashboard. Click on Manage Jenkins > Manage Plugins. In the Available tab, search for Deploy to Container Plugin and install it. Once installed, restart Jenkins to apply the plugin.

  1. Configure Tomcat Server in Jenkins: Now you need to tell Jenkins where your Tomcat server is running.

In Jenkins, go to Manage Jenkins > Configure System. Scroll down to the Deploy to container section. Click Add Tomcat Server.

Provide the necessary information: Name: Give the Tomcat server a name (Tomcat9). URL: The URL of your Tomcat server (e.g., http://localhost:8080). Username: The username for Tomcat's manager app (usually admin). Password: The password for that username (set in Tomcat's tomcat-users.xml). Save the configuration.

  1. Configure Tomcat’s tomcat-users.xml: Make sure Tomcat is set up to allow Jenkins to deploy the application by editing the tomcat-users.xml file.

https://stackoverflow.com/questions/7763560/401-unauthorized-error-while-logging-in-manager-app-of-tomcat

tomcat-users.xml file::

image

Restart Tomcat to apply the changes.

  1. Create a Jenkins Job to Build and Deploy the Application: Next, you need to create a Jenkins job that will build your web application (e.g., a WAR file) and deploy it to Tomcat.

From the Jenkins dashboard, click New Item.

Select Freestyle Project, give it a name, and click OK.

In the job configuration, go to the Build section and configure your build step, such as building a Maven project For Maven, you can use:

mvn clean install

In the Post-build Actions section, add Deploy war/ear to a container.

In the WAR/EAR files field, provide the path to your WAR file (e.g., target/my-app.war). In the Container field, choose the Tomcat server you configured earlier. Set the Context Path (e.g., IfocusAWSDevOpsTraining), which is the URL path where the application will be accessible on Tomcat. If you want Jenkins to deploy automatically after every successful build, check the option Deploy after every successful build. Save the job.

  1. Trigger the Build and Deployment: Go to the Jenkins job you just created and click Build Now to trigger a build. After the build completes, Jenkins should deploy the WAR file to your Tomcat server.

You can access your application by going to http://<tomcat_host>:<tomcat_port>/<context_path>

example:: http://localhost:8080/IfocusApplication/

POLL SCM:: * * * * * (every minute automatic build & deployment happend when new commits happend in github) This setup will allow Jenkins to automatically build and deploy your Java web application to Tomcat with each new build

Polling SCM (Source Code Management) and webhooks are two common methods used for integrating continuous integration (CI) systems or automating tasks based on changes in repositories.

  1. Polling SCM Polling SCM is a method where a system (like Jenkins, GitLab CI, etc.) periodically checks the source code repository for changes. If it detects changes, it triggers the build process or some other automated task.

How it works:

A job is set up to check the SCM (like GitHub, GitLab, Bitbucket, etc.) at regular intervals (e.g., every minute or hour).

The CI server pulls the repository to see if there are any new commits since the last poll.

If changes are detected, it triggers the CI/CD pipeline to build, test, or deploy the application.

  1. Webhooks Webhooks provide a more efficient method for triggering actions based on changes in the repository. Rather than the CI system polling for changes, the source control platform sends an HTTP POST request (webhook) to the CI system when an event (like a commit or pull request) occurs.

image

CI/CD::

Github Project URL:::

https://github.com/srinfotech7358/onlinebookstore.git

image

TomcatIntegarteWithJenkins::

image

image

image

POLL SCM

image

Build Steps

image

Post-build Actions

Deploy war/ear to a container

WAR/EAR files ----> target/*.war

Context path ---> SRinfotechAWSTraing

image

Tomcat 9.x Remote

image

Tomcat URL:: http://localhost:8080

image

07/07/2025::

CI/CD::

Continuous Integration & Continutes Deployment & COntinuoues Delivery::

Continuous Integration(CI)::the practice of automating the integration of code changes from multiple Developers into a single software project. It's a primary DevOps best practice, allowing developers to frequently merge code changes into a central repository,after which automated builds and tests are run automatically.

developers frequently commit to a shared repository using a version control system such as Git,A continuous integration automatically builds and runs unit tests on the new code changes to immediately using jenkins Orchestration.

image

Continuous Deployment(CD) :: Continuous Deployment is an extension of continuous delivery. With continuous deployment, every change that passes through the automated tests and builds is automatically deployed to production without any human intervention. The deployment process is fully automated.

Continuous Delivery (CD)::Continuous Delivery is a software development practice in which code changes are automatically built, tested, and prepared for release to production in a consistent and reliable manner. The key distinction of continuous delivery is that the process of deploying the code to production is done manually by a human decision-maker.

Deploy Onlinebookstore/spring-petclinic applications to target server (Tomcat)::

please create one new pipeline job

Provide the Description

image

Enabled POLL SCM

image

In Pipeline Section write groovy script using Declarative style

image

Generate Deploy pipeline script::

Script::

pipeline { agent any

tools{

    maven 'maven'
}

stages{ stage('Git checkout'){

steps{

    git branch: 'main' url: 'https://github.com/parasa7358/Petclinic.git'

}

}

stage('clean and install'){

steps{

  sh 'mvn clean install'

}

}

stage('Package'){

steps{

  sh 'mvn package'

}

}

stage('Archive the Artifacts'){

steps{

  sh 'mvn clean install'
}
post{
    success{

        archiveArtifacts artifacts: '**target/*.war'
    }
}

}

stage('Test Cases'){

steps{

  sh 'mvn test'

}

}

stage('Deploy to tomcat server'){

steps{

  deploy adapters: [tomcat9(credentialsId: 'tomcat9credentials', path: '', url: 'http://localhost:8080/')], contextPath: 'SRINFOTECH', war: '**/*.war'

}

}

} }

Run the job

image

image

Integrate Jenkins with Tomcat using Declarative Approach::

To integrate Jenkins with Tomcat using the Declarative Pipeline approach, you'll be using Jenkins Pipeline syntax to automate the deployment process to a Tomcat server. This process typically involves building the application, packaging it, and then deploying it to Tomcat.

  1. Jenkinsfile Configuration (Declarative Pipeline)

In your Jenkins project, you'll create a Jenkinsfile, which contains the Declarative Pipeline syntax. This file defines the steps involved in the CI/CD pipeline.

Please execute below script in jenkins pipeline job using Declarative style

pipeline { agent any

tools{

    maven 'maven'
}

stages{ stage('Git checkout'){

steps{

    git branch: 'main', url: 'https://github.com/srinfotechbatch2/Petclinic.git'

}

}

stage('clean and install'){

steps{

  bat 'mvn clean install'

}

}

stage('Package'){

steps{

  bat 'mvn package'

}

}

stage('Archive the Artifacts'){

steps{

  bat 'mvn clean install'
}
post{
    success{

        archiveArtifacts artifacts: '**target/*.war'
    }
}

}

stage('Test Cases'){

steps{

  bat 'mvn test'

}

}

stage('Deploy to tomcat server'){

steps{

  deploy adapters: [tomcat9(credentialsId: 'tomcat9credentials', path: '', url: 'http://localhost:8080/')], contextPath: 'SRINFOTECH', war: '**/*.war'

}

}

} }

Onlinebookstore::

pipeline { agent any

stages {
    stage('Clone') {
        steps {
            git branch: 'master', url: 'https://github.com/srinfotech7358/onlinebookstore.git'
        }
    }
    
      stage('Build') {
        steps {
           bat 'mvn clean install'
        }
    }
     stage('Generate Artifacts') {
        steps {
           archiveArtifacts artifacts: 'target/*.war', followSymlinks: false
        }
    }

      stage('Deploy to Tomcat Server') {
        steps {
           deploy adapters: [tomcat9(alternativeDeploymentContext: '', credentialsId: 'Tomcat', path: '', url: 'http://localhost:8080')], contextPath: 'SR INFOTECH SOLUTIONS PVT LIMITED', war: 'target/*.war'
        }
    }
}

}

10/07/2025::

Introduction to SonarQube::

SonarQube is an open-source platform developed by SonarSource that is used for continuous inspection of code quality. It helps developers and development teams identify bugs, code smells, vulnerabilities, and duplication in their codebases across multiple programming languages.

Key Features of SonarQube Static Code Analysis SonarQube analyzes source code without executing it, detecting issues like:

Bugs

Vulnerabilities

Code smells (bad design or coding practices)

Duplications

Technical debt

Sonarqube Integrate With Jenkins::

image

Sonarqube installed link::

https://gist.github.com/dmancloud/0abf6ad0cb16e1bce2e907f457c8fce9

default U/P ---admin/admin

default port number:: 9000

Server URL: URL to your SonarQube instance (e.g., http://localhost:9000). and default port is 9000

To integrate SonarQube with Jenkins, you need to ensure that Jenkins can communicate with your SonarQube server to perform static code analysis during your CI/CD pipeline. This will allow you to analyze your code quality and get reports from SonarQube as part of your build process.

Here's how you can integrate SonarQube with Jenkins:please follow below steps

  1. Install the SonarQube Plugin in Jenkins Before you start, ensure that you have the SonarQube Scanner Plugin installed in Jenkins:

Go to Jenkins Dashboard. Click on Manage Jenkins → Plugins. Go to the Available tab, and search for SonarQube Scanner. Install it and restart Jenkins.

  1. Configure SonarQube in Jenkins Next, you need to configure SonarQube on Jenkins so it can communicate with your SonarQube server.

11/07/2025::

Steps:

Go to Jenkins Dashboard. Click on Manage Jenkins → Configure System. Scroll down to the SonarQube servers section and click Add SonarQube.

Fill in the following details:

Name::: Give your SonarQube instance a name (SonarQubeServer). Server URL: URL to your SonarQube instance (e.g., http://localhost:9000). and default port is 9000 Server Authentication Token: You can generate a token in SonarQube by navigating to My Account → Security → Generate Tokens. Paste this token into Jenkins. Click Save.

  1. Configure the SonarQube Scanner in JenkinsSteps: =============================================== In the Configure System page, scroll to the SonarQube Scanner section. Click Add SonarQube Scanner and select SonarQube Scanner for Jenkins.

If you want to use a custom installation, specify the path to the SonarQube Scanner binary. Click Save.

Configure SonarQube Project::

Go to your SonarQube server (e.g., http://localhost:9000). Create a project or use an existing one. Obtain the Project Key from the SonarQube project and update the pipeline script as shown in the sonar.projectKey parameter.

Go to Projects and click Local project

image

Click Next

image

Selected Use the global setting

image

Click Create Project

image

Now Spring-petclinic Project created in Sonarqube

image

Click Locally

image

image

Click Generate for Token

Analyze "spring-petclinic12": sqp_0eb364758c5186bea4077eff841ddb99ba89a3ab

image

Click Continue

image

image

Selected Maven and copy below script from sonarqube and it will help to integrate Sonarqube with jenkins pipeline

image

mvn clean verify sonar:sonar
-Dsonar.projectKey=spring-petclinic12
-Dsonar.projectName='spring-petclinic12'
-Dsonar.host.url=http://localhost:9000
-Dsonar.token=sqp_0eb364758c5186bea4077eff841ddb99ba89a3ab

IntegrateSonarqubeWithJenkins::

Go To jenkins and create new job IntegrateSonarqubeWithJenkins

image

Please use below script to run the pipeline job

pipeline { agent any

tools{

    maven 'maven'
}

stages{ stage('Git checkout'){

steps{

    git branch: 'main', url: 'https://github.com/parasa7358/Petclinic.git'

}

}

stage('clean and install'){

steps{

  bat 'mvn clean install'

}

}

stage('Package'){

steps{

  bat 'mvn package'

}

}

stage('Archive the Artifacts'){

steps{

  bat 'mvn clean install'
}
post{
    success{

        archiveArtifacts artifacts: '**target/*.war'
    }
}

}

stage('Test Cases'){

steps{

  bat 'mvn test'

}

}

stage('Sonarqube Analysis'){

steps{

  bat 'mvn clean package'

bat '''mvn sonar:sonar \

-Dsonar.projectKey=spring-petclinic
-Dsonar.projectName='spring-petclinic'
-Dsonar.host.url=http://localhost:9000
-Dsonar.token=sqp_8d74d659dbf3d3bf2924a0d24104f5ddba914fac'''

}

}

stage('Deploy to tomcat server'){

steps{

  deploy adapters: [tomcat9(credentialsId: 'tomcat9credentials', path: '', url: 'http://localhost:8080/')], contextPath: 'Ifocus Solutions Pvt Ltd', war: '**/*.war'

}

}

} }

  1. please start Jenkins on your machine & make sure Jenkins server is UP & Running state
  2. please start Tomcat on your machine & make sure Tomcat server is UP & Running state
  3. please start Sonarqube on your machine & make sure Sonarqube server is UP & Running state

once above steps done then we can execute below script

Working Scripts CI/CD::

pipeline{

tools{

    maven 'Maven'
}

agent any

stages{

stage('Clone'){

    steps{

        git branch: 'main', url: 'https://github.com/srinfotech7358/Petclinic.git'
    }
}

 stage('Build') {
        steps {
           bat 'mvn clean install'
        }
    }

     stage('Test Cases') {
        steps {
           bat 'mvn test'
        }
    }

     stage('Archive the Artifacts') {
        steps {
           archiveArtifacts artifacts: 'target/*.war', followSymlinks: false
        }
    }

stage('Sonarqube Analysis') { steps {

           bat 'mvn package'
          bat '''mvn sonar:sonar \
         -Dsonar.projectKey=spring-petclinic \
         -Dsonar.projectName='spring-petclinic' \
        -Dsonar.host.url=http://localhost:9000 \
        -Dsonar.token=sqp_96cf5222ab632b69c14baa5590210a7125185d5a'''
        }
    }

stage('Deploy Application into Tomcat Server') { steps { deploy adapters: [tomcat9(alternativeDeploymentContext: '', credentialsId: 'NewTomcat', path: '', url: 'http://localhost:8080/')], contextPath: 'Test', war: 'target/*.war' } }

}

}

Once sonarqube scanner done, please verify the sonarqube dashboard for reports & results

image

Go to Administration

image

Click Projects & Select Background Tasks

image

You can able to see all scanned projects status

image

Click on any Project, see the PASSED the quality gates

image

Click on Overall Code option

image

image

see the results

image

here Code coverage is

Coverage 82.7%

image

NOTE:: Coverage is greater than or equal to 80.0%, this should be maintained minimum % every project

NOTE:::Duplicated Lines (%) is less than or equal to 3.0%

Create My own Quality Gates::

Go to Dashboard click on Quality Gates

image

at left side we can see create & just click on it

image

Provide the Name & Click Create

image

Your own quality gates are created

image

this is your own quality gates

image

nditions on New Code Metric Operator Value Issues is greater than 0 Security Hotspots Reviewed is less than 100% Coverage is less than 80.0%

 Duplicated Lines (%) is greater than

select your project

image

apply the Grant permissions to a user or a group

image

Apply all the permissions & click Add

image

image

image

Create my own Quality Profile::

go to Quality Profiles

image

select Language

image

total java Rules 527

image

at right saide top click create

image

provide the Language & Name and click Create

image

your own profile

image

click Active More rules

image

Bulk Change

image

Activate In Spring-pipeline project

image

Sure Apply

image

Succcessfully Applied my own quality profile rules

Activate In Quality Profile (683 rules)

image

Now we are successfully onboarded spring-petclininc project to Sonarqube server

image

image

image

Running the Pipeline Once the pipeline is configured, Jenkins will execute the SonarQube analysis during the build process. After the build completes, you can view the analysis results in your SonarQube dashboard.

Code coverage Code smells Bugs Vulnerabilities Duplications These reports will be available in the SonarQube dashboard for your project.

12/07/2025::

Jfrog Artifactory Overview::

JFrog Artifactory is a universal artifact repository manager that serves as a central hub for storing, managing, and distributing software artifacts, binaries, packages, and other assets throughout the software development lifecycle, improving automation, and ensuring release integrity.

image

Artifact Repository Management:

Allows for storing binaries and artifacts (e.g., libraries, packages, Docker images) in a centralized location. Supports all major package types (e.g., Maven, Gradle, npm, NuGet, RubyGems, etc.). Version Control:

Helps in managing versions of your artifacts and ensures the correct version is used during builds and deployments. Integration with CI/CD:

Integrates seamlessly with CI/CD tools like Jenkins, Bamboo, GitLab CI, and others. Enables automated publishing of artifacts as part of your continuous integration pipeline. Access Control & Security:

Provides fine-grained access control and permissions for users and groups. Supports user authentication, security, and audit trails to ensure compliance and secure artifact management. Replication:

Allows you to replicate artifacts across multiple Artifactory instances, ensuring high availability and disaster recovery capabilities. Remote Repositories:

Artifactory can proxy remote repositories, allowing you to cache and fetch external dependencies without re-downloading them each time. Promotion & Release Management:

You can "promote" artifacts from one repository to another (e.g., from a development repository to a production repository), allowing for better control over releases. Multi-Platform Support:

Artifactory supports multiple programming languages and platforms, making it a universal solution for managing software dependencies and releases.

AWS (Amazon Web Services)::

Create AWS Free tier Account::

Please go throw the recorded video session and follow the steps to create the free tier AWS account.Let me know if anyone facing any issues.

Amazon Web Services (AWS) is a comprehensive and widely adopted cloud platform offered by Amazon. It provides a broad set of services to help organizations and individuals build and scale applications, manage data, and process workloads in the cloud. AWS is designed to provide flexible, scalable, and cost-effective solutions for computing, storage, networking, machine learning, and much more.

13/07/2025::

Integrate Jfrog with Jenkins::

image

First Step:: https://jfrog.com/download-jfrog-platform/ ---download url

image

previous versions link

https://jfrog.com/download-legacy/?product=artifactory&version=7.104.12

All zip version and search 6.12.1 OSS version

https://releases.jfrog.io/artifactory/bintray-artifactory/

jdk compatibility version with jfrog is::

JDK 12.1.0

https://www.oracle.com/in/java/technologies/javase/jdk12-archive-downloads.html

artifactory-oss-6.12.1

All zip version and search 6.12.1 OSS version

https://releases.jfrog.io/artifactory/bintray-artifactory/

Jfrog Script::

stage ('Artifactory Server'){ steps { rtServer ( id: "Artifactory", url: 'http://localhost:8081/artifactory', username: 'admin', password: 'password', bypassProxy: true, timeout: 300 ) } } stage('Upload'){ steps{ rtUpload ( serverId:"Artifactory" , spec: '''{ "files": [ { "pattern": "*.war", "target": "ifocus-solutions-pvt-ltd" } ] }''', ) } } stage ('Publish build info') { steps { rtPublishBuildInfo ( serverId: "Artifactory" ) } }

installed plugin for artifactory (Jfrog)::

image

After installed Artifactory plugin

Go to Manage Jenkins--> System configuration find JFROG

image

Click JFrog Platform Instances

image

For user name and password

Default Jfrog U/P----admin/password

image

image

image

I need to setup target in Jfrog

srinfotech-batch2

click Local repository

image

Select maven

image

Repository key :::: srinfotech-batch2

image

Click save and finish

image

Go to artifacts and check repository is created with name -srinfotech-batch2

image

CI/CD all tools ans stages script:: create new job in jenkins and execute below script

pipeline{ agent any

tools{

maven 'Maven'

}

stages{ stage('Clone The Project'){ steps{ git branch: 'main', url: 'https://github.com/srinfotechbatch2/Petclinic.git' } } stage('Build'){ steps{ bat 'mvn clean install' } } stage('Test'){ steps{ bat 'mvn test' } } stage('Generated the test reports'){ steps{ junit 'target/surefire-reports/.xml' } } stage('published the Artifacts'){ steps{ archiveArtifacts artifacts: 'target/.war', followSymlinks: false } }

stage('SonarQube Analysis'){
    steps{
    bat 'mvn package'
  bat '''mvn sonar:sonar \

-Dsonar.projectKey=spring-petclinic
-Dsonar.projectName='spring-petclinic'
-Dsonar.host.url=http://localhost:9000
-Dsonar.token=sqp_b4f05b06814df65b8d3f1a467f3ed604e2dadb03''' } }

stage ('Artifactory Server'){

        steps {
        
           rtServer (
           
             id: "Artifactory",
             
             url: 'http://localhost:8081/artifactory',
             
             username: 'admin',
             
              password: 'password',
              
              bypassProxy: true,
              
               timeout: 300
               
                    )
        }
        
    }
    stage('Upload'){
    
        steps{
        
            rtUpload (
            
             serverId:"Artifactory" ,
             
              spec: '''{
              
               "files": [
               
                  {
                  
                  "pattern": "*.war",
                  
                  "target": "srinfotech-batch2"
                  
                  }
                  
                        ]
                        
                       }''',
                       
                    )
        }
        
    }
    stage ('Publish build info') {
    
        steps {
        
            rtPublishBuildInfo (
            
                serverId: "Artifactory"
            )
            
        }
        
    }



stage('Deploy to Tomcat Server'){

    steps{
    
        deploy adapters: [tomcat9(alternativeDeploymentContext: '', credentialsId: 'tomcatcredential', path: '', url: 'http://localhost:8080')], contextPath: 'SRInfotechSpringpetclinicJfrog', war: 'target/*.war'
    }

    
}

}

}

JfrogIntegratedWithJenkinsPOLLSCM::

image

21/07/2025::

AWS (Amazon Web Services)::

Amazon Web Services (AWS) is a comprehensive and widely adopted cloud platform offered by Amazon. It provides a broad set of services to help organizations and individuals build and scale applications, manage data, and process workloads in the cloud. AWS is designed to provide flexible, scalable, and cost-effective solutions for computing, storage, networking, machine learning, and much more.

AWS ---Amazon web services

compute services:: Amazon EC2 (Elastic Compute Cloud): Provides scalable virtual servers to run applications. AWS Lambda: Lets you run code without provisioning or managing servers. It automatically scales based on usage.

Storage services:: Amazon S3 (Simple Storage Service): Object storage for storing and retrieving large amounts of data. Amazon EBS (Elastic Block Store): Persistent block-level storage for EC2 instances.

Database:: Amazon RDS (Relational Database Service): Managed relational database service supporting multiple database engines (e.g., MySQL, PostgreSQL, MariaDB, etc.). Amazon DynamoDB: A managed NoSQL database service. Amazon Aurora: A high-performance relational database engine compatible with MySQL and PostgreSQL.

Network services:: Amazon VPC (Virtual Private Cloud): Lets you create isolated networks within AWS for secure connections.

Security ::

AWS IAM (Identity and Access Management): Controls user access and permissions for AWS resources. AWS KMS (Key Management Service): Managed service for creating and controlling encryption keys. Security groups ---inbound, outbould roles

Containers & kuberneties:: ECS ---elastic containers servcies EKS ----estastic kuberneties services AKS ---Azure kuberneties services

Cloud watch --Metrics Monitoring

CloudWatch Metrics allows you to track the performance and utilization of AWS resources such as EC2 instances, RDS databases, Lambda functions, S3 buckets, and much more. These metrics include CPU utilization, disk activity, network traffic, and others. You can create custom metrics for your applications or services as well.

cloud trail ---Security Monitoring:

Use CloudTrail logs to detect unauthorized access or activity in your AWS environment. You can track changes in security settings, unauthorized API calls, or unexpected configuration changes.

Developer Tools:: AWS CodeCommit: Source control service for managing your code repositories. AWS CodeDeploy: Automates code deployments to EC2 instances and Lambda. AWS CodePipeline: Continuous integration and continuous delivery (CI/CD) service for automating the release pipeline.

AWS EC2 ::

Amazon Elastic Compute Cloud (Amazon EC2) is one of the core services provided by Amazon Web Services (AWS)

Wide Variety of Instance Types:

EC2 instances are grouped into families based on the type of workload they are optimized for. Some common instance families include: General Purpose: e.g., t3, m5 instances (balanced CPU, memory, and networking). Compute Optimized: e.g., c5 instances (great for high-performance computing tasks). Memory Optimized: e.g., r5, x1e instances (designed for high-memory workloads like databases).

Master & Node communication Via SSH keys::

image

create EC2 Ubuntu Linux Machine in AWS::

Go to AWS ans Search EC2

image

Click EC2

image

Go to instances at left side bar

image

Click Launch Instances, EC2 ---> Instances -----> Launch an instance

image

Select Ubuntu

image

Select Amazon Machine Image (AMI)

image

select Instance type,t2 medium

image

Create Create new key pair and provide key pair name

image

click create pair

image

click launch instance

image

instance will be created

image

image

22/07/2025::

Master & Node communication Via SSH keys::

i have to create 2 EC2 ubuntu machines in AWS

  1. Jenkinsmaster
  2. Node
image

we have already .pem file dowloaded in you local machin

right click from .pem and click Open git bash here option Now Go to AWS Ubuntu machine which is already created in AWS insatnces and select master machine

image

Click Connect

image

Click SSH Client

image

Copy URL

ssh -i "Newkeysmasternode.pem" ubuntu@ec2-18-237-178-192.us-west-2.compute.amazonaws.com

image

Now past that url in Gitbash

image

switch to root user below command run

Sudo -i

image

update the all packages ,please run below command

sudo apt-get update

image

Install JDK & Maven:;

JDK link

https://bluevps.com/blog/how-to-install-java-on-ubuntu

MAven link

https://phoenixnap.com/kb/install-maven-on-ubuntu

sudo apt-get install maven java -version mvn -v

Set java home environment

sudo vi /etc/environment JAVA_HOME=”/usr/lib/jvm/java-8-openjdk-amd64/jre” MAVEN_HOME=”/usr/share/maven”

Reload your system environment

source /etc/environment

Veriy the variables was set correctly

echo $JAVA_HOME echo $MAVEN_HOME

Insatll Jenkins on master machine::

https://www.digitalocean.com/community/tutorials/how-to-install-jenkins-on-ubuntu-22-04

https://phoenixnap.com/kb/install-jenkins-ubuntu

AWS any machines default password authentication is disabled , we need to enabled in any linux machines

sudo vi /etc/ssh/sshd_config sudo service sshd restart In EC2 – by default password based authentication is disabled so we need to enabled

sudo vi /etc/ssh/sshd_config passwordauthentication :yes

image

In ubuntu machine default user is not sudo user,

visudo Jenkins ALL=(ALL:ALL) NOPASSWD:ALL su Jenkins Switching to new user

image

image

Once installed Jenkins successfully

we need to enabled the Inbounds and outbounds rules in AWS security groups

Inbounds rules

image

Copy public IP address and go to browser Access Jenkins using Public IP address http://35.86.160.156:8080/

bydefault Jenkins runs on port 8080 Jenkins home path/var/lib/Jenkins How to change the port number in Jenkins:: https://stackoverflow.com/questions/28340877/how-to-change-port-number-for-jenkins-installation-in-ubuntu-12-04

sudo nano /etc/default/jenkins

Now Go to Node Machine::

Please insatll JDK & Maven in node machine and setup environemnt varibles

sudo apt-get install maven

java -version

mvn -v

Set java home environment

sudo vi /etc/environment

JAVA_HOME=”/usr/lib/jvm/java-8-openjdk-amd64/jre”

MAVEN_HOME=”/usr/share/maven”

Reload your system environment

source /etc/environment

Veriy the variables was set correctly

echo $JAVA_HOME

echo $MAVEN_HOME

comminicate master & node via SSH keys

ssh-keygen

after generated copy the public & Private keys to node machine

option-1 to copy keys from master to node

ssh-copy-id user@ipaddressofnodemachine

ssh-copy-id node@172.31.44.169

2nd option --copy keys manually from master to node

3rd options --i have created authorized_keys file in node machine and copy public key from master to node

Master Node Configuration::

got to manage Jenkins

manage Nodes

click new node

Remote root directory

/home/node

image

image

Launch methods via ssh

image

Add credentials

image

Host Key Verification Strategy image

Add credentials ::

option-1::

this time please use credentials option SSH key with private key from node machine

Session NOTE::

Master & Node Communicatiion Via SSH keys::

sudo -i sudo apt update java --version mvn -v

environment setup::

Maven home: /usr/share/maven

sudo apt install maven

Java Home:: /usr/lib/jvm/java-17-openjdk-amd64

sudo apt install openjdk-17-jdk

sudo vi /etc/environment

1.press i from your keyboard 2.press the esc from your keyboard 3. shift+: 4. wq 5. press Enter

echo $JAVA_HOME /usr/lib/jvm/java-17-openjdk-amd64

echo $MAVEN_HOME /usr/share/maven

ssh-keygen -t ed25519

su su jenkins

visudo

Allow members of group sudo to execute any command

jenkins ALL=(ALL:ALL) NOPASSWD:ALL

ctrl+X yes enter

in aws passwordauthenticatuion is disabled , you need to enabled the passwordauthentication

sudo vi /etc/ssh/sshd_config

PasswordAuthentication yes

NODE Machine::

1.sudo adduser node 2.user should provide the sudo permissions

visudo

Allow members of group sudo to execute any command

node ALL=(ALL:ALL) NOPASSWD:ALL

3.passwordauthentication is enabled

sudo vi /etc/ssh/sshd_config cd ~

ssh node@172.31.37.219

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published