Jenkins.pdf

326KUBAVATHARSHALBHA 271 views 17 slides Sep 27, 2022
Slide 1
Slide 1 of 17
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17

About This Presentation

Introduction to Jenkins


Slide Content

Introduction to Jenkins
By
Dr.Bhushan Jadhav
Assistant Professor
Thadomal Shahani Engineering College

Plugins in Jenkins
Hands on with Jenkins
Introduction to Jenkins
Agenda
Overview of Continuous Integration
Pipeline in Jenkins

•Jenkinsisanopensourceautomationserverwhichenablesdevelopersaround
theworldtoreliablybuild,test,anddeploytheirsoftware.
•Ithelpsautomatethepartsofsoftwaredevelopmentrelatedtobuilding,testing,
anddeploying,facilitatingcontinuousintegrationandcontinuousdelivery.
•Jenkinsisanopensourcecontinuousintegration/continuousdeliveryand
deployment(CI/CD)automationsoftwareDevOpstoolwrittenintheJava
programminglanguage.ItisusedtoimplementCI/CDworkflows,called
pipelines.
Introduction to Jenkins

•Itisaserver-basedsystemrunninginaservletcontainersuchasApacheTomcat.
•Jenkinsisanaward-winningapplicationthatmonitorsexecutionsofrepeatedjobs,
suchasbuildingasoftwareprojectorjobsrunbyCron.
•InOldDaysofSoftwareDevelopmentCodechangesmadebyindividualteam
membersaremergedtogetherintoworkingsoftware,whichwasknownas
Integrationphase.
•Integrationphasewasahardworkwhichoftenresultsincodeconflicts,hardtofind
bugsandevenhardertofixthemwhichleadtosignificantdeliverydelays
Introduction to Jenkins

•Todaybusinessesneednewfeaturestobeincorporatedintoapplicationinto
days/weeksnotmonths.Thisrequiresachangeinhowsoftwaresarebuilt.
•ContinuousIntegration(CI)isadevelopmentpracticethatrequires
developerstointegratecodeintoasharedrepositoryseveraltimesaday.
•Eachcheck-inisthenverifiedbyanautomatedbuild,allowingteamstodetect
problemsearly.
Continuous Integration (CI)

•Developerscommitcodetoashared
repositoryonaregularbasis.
•Versioncontrolsystemisbeingmonitored.
Whenacommitisdetected,abuildwillbe
triggeredautomatically.•
•Ifthebuildisnotgreen,developerswillbe
notifiedimmediately.
Continuous Integration

•GitLab
•TravisCI
•CircleCI
•Bamboo
•TeamCity
•AWS CodePipelinefor Amazon users
and so on…….
Jenkins Alternatives

•Apipelineisacollectionofjobsthatbringsthesoftwarefromversioncontrol
intothehandsoftheend-usersbyusingautomationtools.
•ItisafeatureusedtoincorporateContinuousDelivery(CD)inoursoftware
developmentworkflow.
Jenkins Pipeline

•ItmodelssimpletocomplexpipelinesascodebyusingGroovyDSL(DomainSpecific
Language)
•ThecodeisstoredinatextfilecalledtheJenkinsfilewhichcanbecheckedintoa
SCM(SourceCodeManagement)
•Improvesuserinterfacebyincorporatinguserinputwithinthepipeline
•ItisdurableintermsofunplannedrestartoftheJenkinsmaster
•Itcanrestartfromsavedcheckpoints
•Itcanintegratewithseveralotherplugins
Jenkins Pipeline Advantages

•AJenkinsfileisatextfilethatstorestheentireworkflowascodeandit
canbecheckedintoaSCMonyourlocalsystem.
•TheJenkinsfileiswrittenusingtheGroovyDSLanditcanbecreated
throughatext/groovyeditororthroughtheconfigurationpageonthe
Jenkinsinstance.
Jenkins File

•TheJenkinspipelineiswrittenbasedontwosyntaxes,namely:
1.Declarativepipelinesyntax
2.Scriptedpipelinesyntax
InDeclarativepipeline,thepipelinecodeeasiertoreadandwrite.Thiscodeis
writteninaJenkinsfilewhichcanbecheckedintoasourcecontrol
managementsystemsuchasGitwhileScriptedPipelineisbuiltontopofthe
underlyingPipelinesub-system.UnlikeDeclarative,ScriptedPipelineis
effectivelyageneral-purposeDSLbuiltwithGroovy.
Jenkins Pipeline

•PluginshavebeenreleasedforJenkinsthatextenditsusetoprojectswritteninlanguagesotherthan
Java.
•PluginsareavailableforintegratingJenkinswithmostversioncontrolsystemsandbugdatabases.
•Manybuildtoolsaresupportedviatheirrespectiveplugins.PluginscanalsochangethewayJenkins
looksoraddnewfunctionality.
•Thereareasetofpluginsdedicatedforthepurposeofunittestingthatgeneratetestreportsin
variousformatsandautomatedtestingthatsupportsautomatedtests.
•Buildscangeneratetestreportsinvariousformatssupportedbyplugins(JUnitsupportiscurrently
bundled)andJenkinscandisplaythereportsandgeneratetrendsandrenderthemintheGUI.
Plugins

•Apache Maven is a software project management and Build Management tool.
•It is based on the concept of a Project Object Model (POM)
•Maven can mange a project’s build, reporting a documentation form
•Ant is a “build Managenttool” –especially useful to compile, package, deploy Java projects
•It can do much more -file operations, version control/CVS, XML validations/transforms, run system
commands, custom tasks, etc
•Ant is suitable also for all kinds of Java-unrelated file manipulations
Build Management in Jenkins

•Gradle is a general purpose build system
•It comes with a rich build description language (DSL) based on Groovy
•It has built-in plug-ins for Java, Groovy, Scala, Web Groovy as a base language allows imperative
programming in the build file
•Artifact:Anartifactissomethingthatiseitherproducedorusedbyaproject.
ExamplesofartifactsproducedbyMavenforaprojectinclude:JARs,sourceand
binarydistributions,WARs.Eachartifactisidentifiedbyagroupid,anartifactID,a
version,anextensionandaclassifier(extension+classifiermaybenamedbyatype).
Build Management in Jenkins

•Installation of Jenkins on Windows/Linux
•Configuring Jenkins
•Installing Plugins
•Executing Simple Batch Jobs in Jenkins
•Executing Pipeline Script in Jenkins
Hands on Jenkins

•https://en.wikipedia.org/wiki/Jenkins_(software)
•https://www.jenkins.io/
•https://www.edureka.co/jenkins
•https://www.edureka.co/blog/jenkins-pipeline-tutorial-continuous-delivery
•https://www.slideshare.net/abediaz/introduction-to-jenkins
•https://www.slideshare.net/jph98/jenkins-ci-presentation
References

Thank
You