Jenkins_RunningNotes
Jenkins_RunningNotes
===========
Prereq:
-------
JDK11/17
Jenkins.war--https://get.jenkins.io/war-stable/2.361.4/
Maven--https://dlcdn.apache.org/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-
bin.zip
Eclipse/STS--https://www.eclipse.org/downloads/download.php?file=/technology/epp/
downloads/release/2024-03/R/eclipse-jee-2024-03-R-win32-x86_64.zip
SonarQube Server(optional)
Git
Notepad++
Github Account----Code repo
Jav/SpringBoot App---demonistration
Tomcat Server 8.0/8.5
======================================
>>We need to install required Plugins for the pipeline creations.
>>Tools configuration in jenkins.
>>Eclipse/VSCODE/Intelli-j---push--->Git--Push--->Github----->SonarQube----
>Jenkins---->Testing---->deploy code to Tomcat
Port no is of 4 digits.
Rule:In some organizations they wont allow port no which starts wwith 5,6,7,9.
Maven Integration
SonarQube
Git
Github
MAtrix based authorization Service
Delivery Pipeline
>>Installing and Uninstalling of plugins.
================================
Day 2-21-March-2024
------------------------
>>jenkins will store plugin data and other data that is related to jenkins in
".jenkins" folder.
>>For monitoring Jenkins we will use "Java Melody" Plugin.
>>To design a S/w,we can design by following methodologies
1)Waterfall approach---Older approach.There are some drawbacks in water fall ie
mainly changes cannot be accomadated.
2023---Sep-1
2024-JAn-9---i want some changes in code
>>In olden days--to deploy code to server,it takes min of 2 days to max 6 days.
Automation: 1 hr
In olden days to integrate new code with old code it takes days.Biut now due to CI
tools,we can integrate the new code with old code with mins.
>>Devops also reduces Infrastructure cost.
Configuration Management:
All the associates shld maintain same softwares with same versions.
MAni--jfdk1.8
Srini---jdk1.9 How an IT team install same s/w for all associates?
sol)Config management tools
Through this tools,an Admin can sit at one location and can controll all associates
Laptops and also he cn install/uninstall/debugg the softwares ata time.These are
done though some python scripts.
agent--s/w program
Master(Puppet)--agent---Slaves
S/w in backend.
foreground
python/groovy script--Write some puppet code snippet in python
>>Drawbacks in jenkins:
=======================
>Jenkins is useless wihout plugins.jenkins cannot work without plugings.
>Jenkins cannt work independently.
>In jenkins we cannt create bulk users.
>Security features are less.
>UI is not upto the market standards.
>to create a Piple line,we need to learn grovy.that is learning curve is more.
----------------
>>In eclipse>>>Created Maven project>>Wrote the code
>>clean install the project.
>>we had initiated repo---git init
>>git add *
>>git commit -m "commit"
>To check whether commit was done: git log
Note: commit means saving code to git repository
>>created New Itrem>>Source code Management>>Git-repository link>>Build
Phase>>>Goals clean install>>>Save
Code was written Eclipse---->Code was pushed to Git---->From git Code was pushed to
Cloud Github---->SonarQube----->Jenkins---->TEst the Project------>Build
https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-9.9.4.87374.zip?
_gl=1*1ha7j5z*_gcl_au*MTIxNjIyNzc1OS4xNzA4MTg2NDQw*_ga*OTc5MjI5Mi4xNzA4MTg2NDQy*_ga
_9JZ0GZ5TC6*MTcxMTA5MjQ0Ni4zLjEuMTcxMTA5MjU0My41NC4wLjA.
========================
Day4&5
-----
Pipeline Creation
Groovy Scripts
CLI--Overview
SonarQube Code Quality
Tomcat Deployment
Master Slave Architecture
\---
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<user username="admin" password="admin" roles="manager-gui,manager-script"/>
>>>>
Java--->
J2SE/JSE===>java Basics,JNDI,Swing,AWT...etc---Desktop apps
J2EE/JEE===>EJB,Servlets,jsp,....etc---Designing Enterprise apps
J2ME/JME===>Mobile devlopment/Embeddded Systesms---apk
Container means tomcat.Container is a s/w program which knows how to run lifecycle.
Container as JVM.Containers are mainly for Servers.
A container cannt exist without server.
Server can exist without container,but there is no use of that server.
Tomcat has 2 containers---Catalina,JAsper
J2SE------jar
Jenkins CLI
>>>Blue Ocean plugin
<build>
<plugins>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.9.0.2155</version> <!-- Replace with the latest version --
>
</plugin>
</plugins>
</build>
pipeline {
agent any
stages {
stage('Hello') {
steps {
echo 'Hello World'
}
}
}
}
pipeline {
tools {
maven 'maven3'
}
options {
buildDiscarder logRotator(
daysToKeepStr: '15',
numToKeepStr: '10'
)
}
environment {
APP_NAME = "DCUBE_APP"
APP_ENV = "DEV"
}
stages {
stage('Cleanup Workspace') {
steps {
cleanWs()
sh """
echo "Cleaned Up Workspace for ${APP_NAME}"
"""
}
}
stage('Code Checkout') {
steps {
checkout([
$class: 'GitSCM',
branches: [[name: '*/master']],
userRemoteConfigs: [[url:
'https://github.com/spring-projects/spring-petclinic.git']]
])
}
}
stage('Code Build') {
steps {
sh 'mvn install -Dmaven.test.skip=true'
}
}
}
}