JENKINS
VARUN
CI&CD (continuous integration &continuous delivery
/continuous deployment
Continuous Integration
Continuous integration is a software development practice where developers regularly merge their code changes
into a central repository, after which automated builds and tests are run. The key goals of continuous integration
are to find and address bugs quicker, improve software quality, and reduce the time it takes to validate and
release new software updates.
Continuous integration workflow
Continuous delivery is a software development practice where code changes
are automatically built, tested, and prepared for a release to production. It
expands upon continuous integration by deploying all code changes to a
testing environment and/or a production environment after the build stage.
When continuous delivery is implemented properly, developers will always
have a deployment-ready build artifact that has passed through a standardized
test process.
.
Continuous Delivery
Continuous feedback &collaboration
Key features of Jenkins pipeline
Jenkins file
History of Jenkins
Kohsuke Kawaguchi, who is a Java developer, working at SUN Microsystems, was tired of building the code
and fixing errors repetitively. In 2004, he created an automation server called Hudson that automates
build and test task.
In 2011, Oracle who owned Sun Microsystems had a dispute with Hudson open source community, so
they forked Hudson and renamed it as Jenkins.
Both Hudson and Jenkins continued to operate independently. But in short span of time, Jenkins acquired
a lot of contributors and projects while Hudson remained with only 32 projects. Then with time, Jenkins
became more popular, and Hudson is not maintained anymore.
What is Jenkins?
Jenkins is an open source automation tool written in Java programming language that allows continuous integration.
Jenkins builds and tests our software projects which continuously making it easier for developers to integrate changes to the
project, and making it easier for users to obtain a fresh build.
It also allows us to continuously deliver our software by integrating with a large number of testing and deployment technologies.
Jenkins offers a straightforward way to set up a continuous integration or continuous delivery environment for almost any
combination of languages and source code repositories using pipelines, as well as automating other routine development tasks.
With the help of Jenkins, organizations can speed up the software development process through automation. Jenkins adds
development life-cycle processes of all kinds, including build, document, test, package, stage, deploy static analysis and much
more.
Jenkins achieves CI (Continuous Integration) with the help of plugins. Plugins is used to allow the integration of various DevOps
stages. If you want to integrate a particular tool, you have to install the plugins for that tool. For example: Maven 2 Project, Git,
HTML Publisher, Amazon EC2, etc.
For example: If any organization is developing a project, then Jenkins will continuously test your project builds and show you the errors in early
of your development.
Work Flow:
Continuous Integration with
Jenkins
Let's consider a scenario where the complete source code of the application was built and then deployed on test server for
testing. It sounds like a perfect way to develop software, but this process has many problems.
Developer teams have to wait till the complete software is developed for the test results.
There is a high prospect that the test results might show multiple bugs. It was tough for developers to locate those bugs
because they have to check the entire source code of the application.
It slows the software delivery process.
Continuous feedback pertaining(related) to things like architectural or coding issues, build failures, test status and file release
uploads was missing due to which the quality of software can go down.
The whole process was manual which increases the threat of frequent failure.
Let's see how Jenkins works
Advantages of Jenkins
It is an open source tool.
It is free of cost.
It does not require additional installations or components. Means it is easy to install.
Easily configurable.
It supports 1000 or more plugins to ease your work. If a plugin does not exist, you can write the script
for it and share with community.
It is built in java and hence it is portable.
It is platform independent. It is available for all platforms and different operating systems. Like OS X,
Windows or Linux.
Easy support, since it open source and widely used.
Jenkins also supports cloud based architecture so that we can deploy Jenkins in cloud based platforms
Disadvantages of Jenkins
Its interface is out dated and not user friendly compared to current user interface trends.
Not easy to maintain it because it runs on a server and requires some skills as server administrator to
monitor its activity.
CI regularly breaks due to some small setting changes. CI will be paused and therefore requires some
developer's team attention.
Web hook
So, what exactly is a webhook? A webhook (also called a web callback or HTTP push API) is a way for an
app to provide other applications with real-time information
Step1:- click on ngrok extracted file
Step2:- click on ngrok ,when we click on ngrok it will
open command prompt
Step3:- enter the command
ngrok http 8083(port of
Jenkins)
How to integrate maven and Github with Jenkins by
using web-hook
Step4:- copy the URL and paste it in
browser
Step5:- when we paste the url
of ngrok http port it will open
the jenkins
Step6:- click on new item enter the item
name and select freestyle project
Step7:- select the git radio button paste the github url and if
it is private add the credentials & and enter the branch
Cd
Step 8 :- open the github click on settings
Step 9:- select the webhook paste the ngrok
<url>/github-webhook/
Step 10:- click on github hook trigger fot
GITScm polling
Step11:- click on invoke top-level maven
targets and enter maven goals
Step12:- when we click on save web-
hook will triger and project will run
Setting up Email notifaction future
 Step1:-open Jenkins dashboard click on
manage jenkins.
 Step2:- click on configure system.
 Step3:- scroll down and in E-mail notifaction
provide the Smtp server as smtp.gmail.com
Select the check box and enter the Email-id &
password & select the use ssl check box.
 Step4:- Enter the SMTP port as
465 & click on save.
Triggering Email notification
when build got fail
 Step5:-click on new item &select
the freestyle project.
 Step6:-Click on add post-build
action & select the E-mail
notification.
 Step7:- Enter the recipients
Email_id& select send e-mail for
every unstable build.
User management
Step1:- click on manage jenkins
Step2:- select manage users
Step3:- Click on create user & enter all necessary
details click on create user.
Step4:- Users were created
Step5:- open plugin manager&
install the role based plugin.
Step6:-Select the configure global
security.
Step7:- Select the Role based strategy.
Step8:- Click on manage &
assign roles.
Step9:-Click on manage
roles.
Step10:- Add new roles.
Step11:- Create a role & assign the roles, For
pattern we have to give <jobname.*>.
step12:-Assign roles by adding users.
Step13:- Assign item roles by adding
users.(project assigning)
Step14:-check whether the particular
role & project is assigned to the
particular user.
Upstream
 Step1:- Click on add post-build action &
and select build other projects.
An upstream job is a configured project that triggers a project as part of its execution.
 Step3:- check whether upstream
project is created for particular job.
 Step2:- Add the project which is to be build after this
project
Downstream
A downstream job is a configured project that is triggered as part of a execution of pipeline. ... We can
configure one or more projects as downstream jobs in Jenkins.
 Step1:- Click on build triggers &
select build after other projects
are built & add the particular Job.
Pipeline
Jenkins Pipeline (or simply "Pipeline" with a capital "P") is a suite of plugins which supports
implementing and integrating continuous delivery pipelines into Jenkins.
A continuous delivery (CD) pipeline is an automated expression of your process for getting software
from version control right through to your users and customers. Every change to your software
(committed in source control) goes through a complex process on its way to being released. This
process involves building the software in a reliable and repeatable manner, as well as progressing the
built software (called a "build") through multiple stages of testing and deployment.
 Step1:- click on new item enter the
item name & select pipeline.
 Step2:-click on pipeline & select the
pipeline script & Add the Groovy script.
Pipeline script
 Step3:- create the Jenkinsfile
add the script in that & copy
the repository URL.
Pipeline script from scm
 Step4:-Click on pipeline &
select pipeline script SCM &
select git & Paste the Github
Url.
 Step5:- Add the branch name
& script Path click on save.
 Step6:-Check whether the proper pipeline is
created.
Master & Slave
Step1:- click on manage jenkins & select
the manage nodes & clouds.
Step2:- click on new node.
THANK YOU

varun JENKINS.pptx

  • 1.
  • 2.
    CI&CD (continuous integration&continuous delivery /continuous deployment Continuous Integration Continuous integration is a software development practice where developers regularly merge their code changes into a central repository, after which automated builds and tests are run. The key goals of continuous integration are to find and address bugs quicker, improve software quality, and reduce the time it takes to validate and release new software updates.
  • 3.
  • 4.
    Continuous delivery isa software development practice where code changes are automatically built, tested, and prepared for a release to production. It expands upon continuous integration by deploying all code changes to a testing environment and/or a production environment after the build stage. When continuous delivery is implemented properly, developers will always have a deployment-ready build artifact that has passed through a standardized test process. . Continuous Delivery
  • 5.
  • 6.
    Key features ofJenkins pipeline
  • 7.
  • 8.
    History of Jenkins KohsukeKawaguchi, who is a Java developer, working at SUN Microsystems, was tired of building the code and fixing errors repetitively. In 2004, he created an automation server called Hudson that automates build and test task. In 2011, Oracle who owned Sun Microsystems had a dispute with Hudson open source community, so they forked Hudson and renamed it as Jenkins. Both Hudson and Jenkins continued to operate independently. But in short span of time, Jenkins acquired a lot of contributors and projects while Hudson remained with only 32 projects. Then with time, Jenkins became more popular, and Hudson is not maintained anymore.
  • 9.
    What is Jenkins? Jenkinsis an open source automation tool written in Java programming language that allows continuous integration. Jenkins builds and tests our software projects which continuously making it easier for developers to integrate changes to the project, and making it easier for users to obtain a fresh build. It also allows us to continuously deliver our software by integrating with a large number of testing and deployment technologies. Jenkins offers a straightforward way to set up a continuous integration or continuous delivery environment for almost any combination of languages and source code repositories using pipelines, as well as automating other routine development tasks. With the help of Jenkins, organizations can speed up the software development process through automation. Jenkins adds development life-cycle processes of all kinds, including build, document, test, package, stage, deploy static analysis and much more. Jenkins achieves CI (Continuous Integration) with the help of plugins. Plugins is used to allow the integration of various DevOps stages. If you want to integrate a particular tool, you have to install the plugins for that tool. For example: Maven 2 Project, Git, HTML Publisher, Amazon EC2, etc. For example: If any organization is developing a project, then Jenkins will continuously test your project builds and show you the errors in early of your development.
  • 10.
  • 11.
    Continuous Integration with Jenkins Let'sconsider a scenario where the complete source code of the application was built and then deployed on test server for testing. It sounds like a perfect way to develop software, but this process has many problems. Developer teams have to wait till the complete software is developed for the test results. There is a high prospect that the test results might show multiple bugs. It was tough for developers to locate those bugs because they have to check the entire source code of the application. It slows the software delivery process. Continuous feedback pertaining(related) to things like architectural or coding issues, build failures, test status and file release uploads was missing due to which the quality of software can go down. The whole process was manual which increases the threat of frequent failure.
  • 12.
    Let's see howJenkins works
  • 13.
    Advantages of Jenkins Itis an open source tool. It is free of cost. It does not require additional installations or components. Means it is easy to install. Easily configurable. It supports 1000 or more plugins to ease your work. If a plugin does not exist, you can write the script for it and share with community. It is built in java and hence it is portable. It is platform independent. It is available for all platforms and different operating systems. Like OS X, Windows or Linux. Easy support, since it open source and widely used. Jenkins also supports cloud based architecture so that we can deploy Jenkins in cloud based platforms
  • 14.
    Disadvantages of Jenkins Itsinterface is out dated and not user friendly compared to current user interface trends. Not easy to maintain it because it runs on a server and requires some skills as server administrator to monitor its activity. CI regularly breaks due to some small setting changes. CI will be paused and therefore requires some developer's team attention.
  • 15.
    Web hook So, whatexactly is a webhook? A webhook (also called a web callback or HTTP push API) is a way for an app to provide other applications with real-time information
  • 16.
    Step1:- click onngrok extracted file Step2:- click on ngrok ,when we click on ngrok it will open command prompt Step3:- enter the command ngrok http 8083(port of Jenkins) How to integrate maven and Github with Jenkins by using web-hook
  • 17.
    Step4:- copy theURL and paste it in browser Step5:- when we paste the url of ngrok http port it will open the jenkins
  • 18.
    Step6:- click onnew item enter the item name and select freestyle project Step7:- select the git radio button paste the github url and if it is private add the credentials & and enter the branch
  • 19.
    Cd Step 8 :-open the github click on settings Step 9:- select the webhook paste the ngrok <url>/github-webhook/
  • 20.
    Step 10:- clickon github hook trigger fot GITScm polling Step11:- click on invoke top-level maven targets and enter maven goals Step12:- when we click on save web- hook will triger and project will run
  • 22.
    Setting up Emailnotifaction future  Step1:-open Jenkins dashboard click on manage jenkins.  Step2:- click on configure system.
  • 23.
     Step3:- scrolldown and in E-mail notifaction provide the Smtp server as smtp.gmail.com Select the check box and enter the Email-id & password & select the use ssl check box.  Step4:- Enter the SMTP port as 465 & click on save.
  • 24.
    Triggering Email notification whenbuild got fail  Step5:-click on new item &select the freestyle project.  Step6:-Click on add post-build action & select the E-mail notification.
  • 25.
     Step7:- Enterthe recipients Email_id& select send e-mail for every unstable build.
  • 26.
    User management Step1:- clickon manage jenkins Step2:- select manage users
  • 27.
    Step3:- Click oncreate user & enter all necessary details click on create user. Step4:- Users were created
  • 28.
    Step5:- open pluginmanager& install the role based plugin. Step6:-Select the configure global security.
  • 29.
    Step7:- Select theRole based strategy. Step8:- Click on manage & assign roles.
  • 30.
  • 31.
    Step11:- Create arole & assign the roles, For pattern we have to give <jobname.*>. step12:-Assign roles by adding users.
  • 32.
    Step13:- Assign itemroles by adding users.(project assigning) Step14:-check whether the particular role & project is assigned to the particular user.
  • 33.
    Upstream  Step1:- Clickon add post-build action & and select build other projects. An upstream job is a configured project that triggers a project as part of its execution.
  • 34.
     Step3:- checkwhether upstream project is created for particular job.  Step2:- Add the project which is to be build after this project
  • 35.
    Downstream A downstream jobis a configured project that is triggered as part of a execution of pipeline. ... We can configure one or more projects as downstream jobs in Jenkins.  Step1:- Click on build triggers & select build after other projects are built & add the particular Job.
  • 36.
    Pipeline Jenkins Pipeline (orsimply "Pipeline" with a capital "P") is a suite of plugins which supports implementing and integrating continuous delivery pipelines into Jenkins. A continuous delivery (CD) pipeline is an automated expression of your process for getting software from version control right through to your users and customers. Every change to your software (committed in source control) goes through a complex process on its way to being released. This process involves building the software in a reliable and repeatable manner, as well as progressing the built software (called a "build") through multiple stages of testing and deployment.
  • 37.
     Step1:- clickon new item enter the item name & select pipeline.  Step2:-click on pipeline & select the pipeline script & Add the Groovy script. Pipeline script
  • 38.
     Step3:- createthe Jenkinsfile add the script in that & copy the repository URL.
  • 39.
    Pipeline script fromscm  Step4:-Click on pipeline & select pipeline script SCM & select git & Paste the Github Url.  Step5:- Add the branch name & script Path click on save.
  • 40.
     Step6:-Check whetherthe proper pipeline is created.
  • 41.
    Master & Slave Step1:-click on manage jenkins & select the manage nodes & clouds. Step2:- click on new node.
  • 44.