Jenkins PPT
Jenkins PPT
Jenkins PPT
Jenkins
Jenkins is an open source automation tool written in Java with plugins
built for Continuous Integration purpose.
SCM
Continues
BUILD
Monitoring
Jenkins
Continues Continues
Testing Deployment
Configuration
Management
Advantages of Jenkins
Its an open source tool with great community support.
It is easy to install.
It is free of cost
There are several other functions like deploying the build application
on the test server, providing the concerned teams with the build and
test results etc.
Benefits of CI
Catch issue fast and hip them in the bud
Developer
Continuous Integration With Jenkins :
Build and test results are
feedback to developers
Developers
Shared Production
Jenkins server Selenium
Developers Server
Repo
Jenkins check the Jenkins deploy the After successful test
shared repository build application on the build
and every check-in the test server application is then
is pulled and hen deployed to the
build production server
Developers
Continuous Integration With Jenkins
First, a developer commits the code to the source code repository.
Meanwhile, the Jenkins server checks the repository at regular
intervals for changes.
Soon after a commit occurs, the Jenkins server detects the changes
that have occurred in the source code repository. Jenkins will pull
those changes and will start preparing a new build.
If built is successful, then Jenkins deploys the built in the test server.
It will continue to check the source code repository for changes made
in the source code and the whole process keeps on repeating.
Before and After Jenkins
The entire source code was built Every commit made in the source
and then tested. code is built and tested.
Developer have to wait for test Developer know the test result of
result. every commit made in the source
code on the run.
Jenkins Master :
Scheduling build jobs.
Dispatching builds to the slaves for the actual execution.
Monitor the slaves (possibly taking them online and offline as
required).
Recording and presenting the build results.
A Master instance of Jenkins can also execute build jobs directly.
Jenkins Architecture
Jenkins slave:
A Slave is a Java executable that runs on a remote machine.
It hears requests from the Jenkins Master instance.
Slaves can run on a variety of operating systems.
The job of a Slave is to do as they are told to, which involves executing
build jobs dispatched by the Master.
You can configure a project to always run on a particular Slave machine,
or a particular type of Slave machine, or simply let Jenkins pick the next
available Slave.
Jenkins Architecture
Jenkins Master
Jenkins Slave
Jenkins Operation
Center
Jenkins Slave
Jenkins Slave
In build pipeline the build as a whole is broken down into sections, such as the
unit test, acceptance test, packaging, reporting and deployment phases.
• Freestyle Project
• Multiconfiguration Job
• Monitor an External Job
• Maven Project
Freestyle Project
Freestyle build jobs are general-purpose build jobs, which provides
maximum flexibility.
The freestyle build job is the most flexible and configurable option
can be used for any type of project.
Maven Project
The “maven2/3 project” is a build job specially adapted to Maven projects
Jenkins understands Maven pom files and project structures
Can use the information gleaned from the pom file to reduce the work you
need to do to set up your project.
Jenkins Pipeline
Jenkins Pipeline is written into a text file (called a Jenkinsfile) which in
turn is checked into a project’s source control repository.This is the
foundation of "Pipeline-as-Code"; treating the continuous delivery
pipeline a part of the application to be versioned and reviewed like
any other code. Creating a Jenkinsfile provides a number of
immediate benefits:
While the syntax for defining a Pipeline, either in the web UI or with a
Jenkinsfile, is the same, it’s generally considered best practice to
define the Pipeline in a Jenkinsfile and check that in to source control.
Jenkins Pipeline
Jenkinsfile (Declarative Pipeline)
pipeline {
agent any
stages {
stage('Build') {
steps {
sh 'make'
}
}
stage('Test'){
steps {
sh 'make check'
junit 'reports/**/*.xml'
}
}
stage('Deploy') {
steps {
sh 'make publish'
}
}
}
}
Jenkins Pipeline
• agent indicates that Jenkins should allocate an executor and workspace
for this part of the Pipeline.
• junit is a Pipeline step provided by the JUnit plugin for aggregating test
report
Why Pipeline
Jenkins is, fundamentally, an automation engine which supports a number of
automation patterns. Pipeline adds a powerful set of automation tools onto
Jenkins, supporting use cases that span from simple continuous integration
to comprehensive continuous delivery pipelines. By modeling a series of
related tasks, users can take advantage of the many features of Pipeline: