Dev Ops
Dev Ops
1
2
DevOps
3
DevOps
DevOps Lifecycle
The DevOps workflow consists of phases:
4
DevOps
DevOps Lifecycle
Continuous Development
Continuous Integration
Continuous testing
Continuous monitoring
Continuous feedback
Continuous deployment
Continuous operations
5
DevOps
DevOps Lifecycle
Continuous Development
The first phase of the DevOps lifecycle is where the planning and software coding takes place.
The planning involves understanding the vision of the project.
Planning doesn’t involve any major tools, but maintaining the code entails the use of a range of tools.
JavaScript, C/C++, Ruby, and Python are prominently used for coding applications in DevOps.
The process of maintaining the code is called Source Code Management (SCM), where version control tools
such as GIT, TFS, GitLab, Subversion, and Mercurial, among others, are used.
6
7
DevOps
DevOps Lifecycle
Continuous Integration or Code Integration
This stage is the heart of the entire DevOps lifecycle. It is a software development practice in which the
developers require to commit changes to the source code more frequently.
The source code gets modified several times and those changes will happen weekly or daily bases.
In this phase, bugs in the source code are detected early on.
Tools Involved in Continuous Integration: Jenkins, Apache Maven, Apache Tomcat, Sonarqube, Nexux/Jfrog,
etc.
Jenkins is a popular tool used in this phase. Whenever there is a change in the Git repository, then Jenkins
fetches the updated code and prepares a build of that code, which is an executable file in the form of war or
jar. Then this build is forwarded to the test server or the production server.
8
DevOps
9
10
DevOps
DevOps Lifecycle
Continuous Testing
We need some mechanism to run test cases automatically.
Here, the developed software is continuously tested for bugs. A test environment is simulated with the use
of Docker containers.
We will run continuous testing which will run against the deployed software using tools like Selenium,
TestNG and which will generate a report to analyze the failed test cases easy.
TestNG, Selenium and JUnit are some of the DevOps tools used for automated testing and which runs once
the build is deployed and after CD process these tools comes into the picture.
Selenium does the automation testing, and TestNG generates the reports. This entire testing phase can
automate with the help of a Continuous Integration tool called Jenkins.
11
DevOps
DevOps Lifecycle
Continuous Feedback
The application performance is improved consistently by analyzing the final outcome of the product.
The continuous feedback is an important phase of the software application where customer feedback is a
big asset to improve the working of the current software product and release new versions quickly based on
the response.
12
13
DevOps
DevOps Lifecycle
Continuous Deployment
In this phase, the finalized application code is deployed to the production servers.
Conventionally, the phase of continuous deployment takes place before continuous monitoring.
Configuration Management is a key process in this phase, and it carries out the precise deployment of
application code on all servers. Code is released to the servers, updates are scheduled for all servers, and
these configurations are kept consistent throughout the production process.
Ansible, Puppet, and Chef are some of the effective DevOps tools used for Configuration Management,
where they frequently execute the quick and continuous deployment of new code. Docker & Kubernetes are
also used in this phase.
14
DevOps
DevOps Lifecycle
Continuous Monitoring
In this phase, developers record data on the use of application and continuously monitor each functionality.
“Server not reachable” or “low memory” are some of the common system errors resolved in this phase.
ELK, Grafana, Prometheus and Nagios are the key DevOps tools used in continuous monitoring.
15
DevOps
DevOps Lifecycle
Continuous Operations
The last phase of the DevOps lifecycle is the shortest phase and the least complicated one. The purpose of
continuous operation is to automate the process of releasing the application and the subsequent updates.
Development cycles in continuous operations are shorter, allowing developers to ongoingly accelerate the
time-to-market for the application. Conventionally, the phase of continuous deployment takes place before
continuous monitoring.
16
17
DevOps
Maven Tool
Apache Maven is a software project management and comprehension tool and based on the concept of a
project object model (POM), maven can manage a project’s build, reporting and documentation from a
central piece of information.
For the person building a project, this means that it is only necessary to learn a small set of commands to
build any Maven project, and the POM will ensure they get the results they desired.
There are three built-in build lifecycles: default, clean and site.
• The default lifecycle handles your project deployment,
• The clean lifecycle handles project cleaning,
• The site lifecycle handles the creation of your project's web site.
18
DevOps
Maven Tool
There are three types of repositories.
• Local $(HOME)/.m2/repository
• Remote/Private Nexus/Jfrog
• Central/Public Public from maven website
19
20
DevOps
SonarQube
SonarQube is a Code Quality Assurance tool that collects and analyzes source code, and provides reports for
the code quality of your project.
Static code analysis for 17 languages
Java, C#, JavaScript, TypeScript, CloudFormation, Terraform, Kotlin, Ruby, Go, Scala, Flex, Python, PHP, HTML, CSS, XML and
VB.NET
Detect Bugs & Vulnerabilities
Review Security Hotspots
Track Code Smells & fix your Technical Debt
Code Quality Metrics & History
CI/CD integration
Extensible, with 50+ community plugins
21
DevOps
22
DevOps
23
DevOps
24
25
26
DevOps
Jenkins 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.
The definition of a Jenkins Pipeline is written into a text file (called a Jenkinsfile) which in turn can be
committed to a project’s source control repository.
27
DevOps
Jenkins Pipeline
Jenkins has two types of pipelines:
Declarative pipeline
Scripted pipeline
Declarative and Scripted Pipelines are constructed fundamentally differently. Declarative Pipeline is a more
recent feature of Jenkins Pipeline which:
provides richer syntactical features over Scripted Pipeline syntax, and
is designed to make writing and reading Pipeline code easier.
It break down stages into individual stages that can further have multiple steps in that.
For Scripted pipeline, you need to have knowledge on Apache groovy.
28
DevOps
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 CD pipelines. By modeling a series of related tasks, users can take
advantage of the many features of Pipeline:
Code: Pipelines are implemented in code and typically checked into source control, giving teams the ability to edit, review,
and iterate upon their delivery pipeline.
Durable: Pipelines can survive both planned and unplanned restarts of the Jenkins controller.
Pausable: Pipelines can optionally stop and wait for human input or approval before continuing the Pipeline run.
Versatile: Pipelines support complex real-world CD requirements, including the ability to fork/join, loop, and perform work in
parallel.
Extensible: The Pipeline plugin supports custom extensions to its DSL [1] and multiple options for integration with other
plugins.
29
DevOps
30
31