Continuous Integration
by DevOps University
Certified DevOps Foundation Workshop
https://www.devopsuniversity.org/
❖ Workshop Details
❖ Topics Covered in Workshop
➢ Table of contents
❖ DevOps Foundation Certification
➢ Registration for the Exam
➢ Validity of Exam voucher
➢ Certification Exam format
➢ Other details about the Certification
❖ Lab Readiness - Prerequisites for the Workshop
DevOps Foundation Workshop
Agenda
Maven is a build automation tool used primarily for Java projects. Maven can also be used to build and
manage projects written in C#, Ruby, Scala, and other languages.
Maven addresses two aspects of building software: how software is built, and its
dependencies.
The Maven project is hosted by the Apache Software Foundation, where it was formerly
part of the Jakarta Project.
What is Maven?
Maven
DevOps integrates
Developers and operation
teams
to improve collaboration and
productivity
automating infrastructure,
automating workflows
measuring application
performance
by
Continuously
Each of these build lifecycles is defined by a different list of build phases, wherein a build phase
represents a stage in the lifecycle.
validate - validate the project is correct.
compile - compile the source code of the project.
test - test the compiled source code using a suitable unit tests.
package - take the compiled code and package it in its distributable
format, such as a JAR.
verify - run any checks on results of integration tests to ensure quality are met
install – Install package locally to be used as dependency for other projects.
deploy - done in the build environment, copies the final package to the remote repository for sharing
with other developers and projects.
Maven Lifecycle
Maven
Source: SlideShare
by
Maven Lifecycle
Maven
Source: SlideShare
by
Jenkins is a free and open source automation server. It helps automate the parts of software
development related to building, testing, and deploying, facilitating continuous integration and
continuous delivery.
The Jenkins project was originally named Hudson, and was renamed after a dispute with Oracle,
which had forked the project and claimed rights to the project name. The Oracle fork, Hudson,
continued to be developed for a time before being donated to the Eclipse Foundation.
Oracle's Hudson is no longer maintained and was announced as obsolete in February 2017.
On April 20, 2016 version 2 was released with the Pipeline plugin enabled by default. The plugin
allows for writing build instructions using a domain specific language based on Apache Groovy.
Jenkins Introduction
Jenkins
Continuous Integration (CI) is a development practice where developers integrate code into a shared
repository frequently, preferably several times a day.
Each integration can then be verified by an automated build and automated tests. While automated
testing is not strictly part of CI it is typically implied.
In software engineering, continuous integration (CI) implements continuous processes of applying
quality control - small pieces of effort, applied frequently.
Continuous integration aims to improve the quality of software, and to reduce the time taken to deliver
it, by replacing the traditional practice of applying quality control after completing all development.
Continuous Integration
Jenkins
Continuous Integration & Testing
Jenkins
Source: Redhat
Continuous delivery is an extension of continuous integration to make sure that you can release new
changes to your customers quickly in a sustainable way.
This means that on top of having automated your testing, you also have automated your release
process and you can deploy your application at any point of time by clicking on a button.
It aims at building, testing, and releasing software with greater speed and frequency.
The approach helps reduce the cost, time, and risk of delivering changes by allowing for more
incremental updates to applications in production.
However, if you truly want to get the benefits of continuous delivery, you should deploy to production
as early as possible.
Continuous Delivery
Jenkins
Continuous Delivery
Jenkins
Source: Redhat
DevOps CI/CD Pipelines
Jenkins
Source: Medium
DevOps CI/CD Pipelines
Jenkins
Below are some of the benefits of Continuous Integration and Continuous Delivery:
1. Smaller Code Changes: One technical advantage of continuous integration and continuous
delivery is that it allows you to integrate small pieces of code at one time.
2. Fault Isolations: Fault isolation refers to the practice of designing systems such that when
an error occurs, the negative outcomes are limited in scope.
3. Faster Release Rate: Failures are detected faster and as such, can be repaired faster, leading
to increasing release rates.
4. More Testing: Implementing Continuous Integration and Delivery ensures more
automated testing which helps to improve the quality of product.
5. Reduce Costs: Automation in the CI/CD pipeline reduces the number of errors that can
take place in the many repetitive steps of CI and CD.
Continuous Integration & Delivery
Benefits
Jenkins
WHO USES JENKINS?
PLUG-INS
Over 600 plug-ins available for customization
Examples:
• JIRA
• Ant
• Maven
• JUnit
• Javadoc
• SSH
• MSBuild
• NUnit
• PowerShell
• Email Notifications
https://wiki.jenkins-ci.org/display/JENKINS/Plugins
JDK JDK 1.8 or above
Memory 2 GB RAM (recommended)
Disk Space No minimum requirement. However, all builds will be stored
on the Jenkins machines, it has to be ensured that sufficient
disk space is available for build storage.
Operating System Jenkins can be installed on Windows, Ubuntu/Debian, Red
Hat/Fedora/CentOS, Mac OS X, openSUSE, FReeBSD,
OpenBSD, Gentoo.
Java Container The WAR file can be run in any container that supports
Servlet 2.4/JSP 2.0 or later.(An example is Tomcat 5).
● Download Jenkins: Open the official website of Jenkins :
https://jenkins.io/index.html
Click on Download Jenkins and download the LTS Release.
● From the command prompt, browse to the directory where the
jenkins.war file is present. Run the following command:
java -jar jenkins.war
● Extraction of the war file is done by an embedded webserver called
winstone.
● Jenkins by default runs on port 8080, but we can run it on different
port by issuing following command:
java -jar jenkins.war --httpPort=8181
Installation & Configuration Jenkins
● Open http://localhost:8080/jenkins to check the Jenkins
Dashboard.
● We can now get the Jenkins-git setup enabled by
clicking the Manage Jenkins option and then click the
Available tab and enter the search keyword ie; git.
● Install the git plugin and restart Jenkins by issuing this
command in the browser:
http://localhost:8080/jenkins/restart
Installation & Configuration Jenkins
There can be multiple users that can operate Jenkins for the
same set of project holding different responsibility.
● So it is very important to restrict access of users so they can
operate on their responsibility in a controlled manner.
● To manage access of users :
● Click on Manage Jenkins from the home page.
● Click on the link Configure global security.
● Under “Access Control” you will see an “Authorization”
label.
Managing Security
● Open http://localhost:8080/jenkins to check the Jenkins
Dashboard.
● We can now get the Jenkins-git setup enabled by
clicking the Manage Jenkins option and then click the
Available tab and enter the search keyword ie; git.
● Install the git plugin and restart Jenkins by issuing this
command in the browser:
http://localhost:8080/jenkins/restart
Installation & Configuration Jenkins
THANK
training@devopsuniversity.org
YOU

Continous Integration.pptx

  • 1.
    Continuous Integration by DevOpsUniversity Certified DevOps Foundation Workshop https://www.devopsuniversity.org/
  • 2.
    ❖ Workshop Details ❖Topics Covered in Workshop ➢ Table of contents ❖ DevOps Foundation Certification ➢ Registration for the Exam ➢ Validity of Exam voucher ➢ Certification Exam format ➢ Other details about the Certification ❖ Lab Readiness - Prerequisites for the Workshop DevOps Foundation Workshop Agenda
  • 3.
    Maven is abuild automation tool used primarily for Java projects. Maven can also be used to build and manage projects written in C#, Ruby, Scala, and other languages. Maven addresses two aspects of building software: how software is built, and its dependencies. The Maven project is hosted by the Apache Software Foundation, where it was formerly part of the Jakarta Project. What is Maven? Maven DevOps integrates Developers and operation teams to improve collaboration and productivity automating infrastructure, automating workflows measuring application performance by Continuously
  • 4.
    Each of thesebuild lifecycles is defined by a different list of build phases, wherein a build phase represents a stage in the lifecycle. validate - validate the project is correct. compile - compile the source code of the project. test - test the compiled source code using a suitable unit tests. package - take the compiled code and package it in its distributable format, such as a JAR. verify - run any checks on results of integration tests to ensure quality are met install – Install package locally to be used as dependency for other projects. deploy - done in the build environment, copies the final package to the remote repository for sharing with other developers and projects. Maven Lifecycle Maven Source: SlideShare by
  • 5.
  • 6.
    Jenkins is afree and open source automation server. It helps automate the parts of software development related to building, testing, and deploying, facilitating continuous integration and continuous delivery. The Jenkins project was originally named Hudson, and was renamed after a dispute with Oracle, which had forked the project and claimed rights to the project name. The Oracle fork, Hudson, continued to be developed for a time before being donated to the Eclipse Foundation. Oracle's Hudson is no longer maintained and was announced as obsolete in February 2017. On April 20, 2016 version 2 was released with the Pipeline plugin enabled by default. The plugin allows for writing build instructions using a domain specific language based on Apache Groovy. Jenkins Introduction Jenkins
  • 7.
    Continuous Integration (CI)is a development practice where developers integrate code into a shared repository frequently, preferably several times a day. Each integration can then be verified by an automated build and automated tests. While automated testing is not strictly part of CI it is typically implied. In software engineering, continuous integration (CI) implements continuous processes of applying quality control - small pieces of effort, applied frequently. Continuous integration aims to improve the quality of software, and to reduce the time taken to deliver it, by replacing the traditional practice of applying quality control after completing all development. Continuous Integration Jenkins
  • 8.
    Continuous Integration &Testing Jenkins Source: Redhat
  • 9.
    Continuous delivery isan extension of continuous integration to make sure that you can release new changes to your customers quickly in a sustainable way. This means that on top of having automated your testing, you also have automated your release process and you can deploy your application at any point of time by clicking on a button. It aims at building, testing, and releasing software with greater speed and frequency. The approach helps reduce the cost, time, and risk of delivering changes by allowing for more incremental updates to applications in production. However, if you truly want to get the benefits of continuous delivery, you should deploy to production as early as possible. Continuous Delivery Jenkins
  • 10.
  • 11.
  • 12.
  • 14.
    Below are someof the benefits of Continuous Integration and Continuous Delivery: 1. Smaller Code Changes: One technical advantage of continuous integration and continuous delivery is that it allows you to integrate small pieces of code at one time. 2. Fault Isolations: Fault isolation refers to the practice of designing systems such that when an error occurs, the negative outcomes are limited in scope. 3. Faster Release Rate: Failures are detected faster and as such, can be repaired faster, leading to increasing release rates. 4. More Testing: Implementing Continuous Integration and Delivery ensures more automated testing which helps to improve the quality of product. 5. Reduce Costs: Automation in the CI/CD pipeline reduces the number of errors that can take place in the many repetitive steps of CI and CD. Continuous Integration & Delivery Benefits Jenkins
  • 15.
  • 17.
    PLUG-INS Over 600 plug-insavailable for customization Examples: • JIRA • Ant • Maven • JUnit • Javadoc • SSH • MSBuild • NUnit • PowerShell • Email Notifications https://wiki.jenkins-ci.org/display/JENKINS/Plugins
  • 18.
    JDK JDK 1.8or above Memory 2 GB RAM (recommended) Disk Space No minimum requirement. However, all builds will be stored on the Jenkins machines, it has to be ensured that sufficient disk space is available for build storage. Operating System Jenkins can be installed on Windows, Ubuntu/Debian, Red Hat/Fedora/CentOS, Mac OS X, openSUSE, FReeBSD, OpenBSD, Gentoo. Java Container The WAR file can be run in any container that supports Servlet 2.4/JSP 2.0 or later.(An example is Tomcat 5).
  • 19.
    ● Download Jenkins:Open the official website of Jenkins : https://jenkins.io/index.html Click on Download Jenkins and download the LTS Release. ● From the command prompt, browse to the directory where the jenkins.war file is present. Run the following command: java -jar jenkins.war ● Extraction of the war file is done by an embedded webserver called winstone. ● Jenkins by default runs on port 8080, but we can run it on different port by issuing following command: java -jar jenkins.war --httpPort=8181 Installation & Configuration Jenkins
  • 20.
    ● Open http://localhost:8080/jenkinsto check the Jenkins Dashboard. ● We can now get the Jenkins-git setup enabled by clicking the Manage Jenkins option and then click the Available tab and enter the search keyword ie; git. ● Install the git plugin and restart Jenkins by issuing this command in the browser: http://localhost:8080/jenkins/restart Installation & Configuration Jenkins
  • 21.
    There can bemultiple users that can operate Jenkins for the same set of project holding different responsibility. ● So it is very important to restrict access of users so they can operate on their responsibility in a controlled manner. ● To manage access of users : ● Click on Manage Jenkins from the home page. ● Click on the link Configure global security. ● Under “Access Control” you will see an “Authorization” label. Managing Security
  • 22.
    ● Open http://localhost:8080/jenkinsto check the Jenkins Dashboard. ● We can now get the Jenkins-git setup enabled by clicking the Manage Jenkins option and then click the Available tab and enter the search keyword ie; git. ● Install the git plugin and restart Jenkins by issuing this command in the browser: http://localhost:8080/jenkins/restart Installation & Configuration Jenkins
  • 23.