You are on page 1of 26

K PRASANTH KUMAR M.

Tech CSE (JNTUA)


Asst.Professor
DevOps
Unit-4
III B.TECH I SEM
DevOps Text Book
What is Continuous Integration
Continuous integration is a process in Devops where changes are merged into a
central repository after which the code is automated and tested. The continuous
integration process is a practice in software engineering used to merge developers'
working copies several times a day into a shared mainline.
It refers to the process of automating the integration of code changes coming
from several sources. The process comprises several automation tools that
emphasize on the code’s correctness before Integration. 
Continuous Integration is the best practice for software development that has a
set of critical principles. Some of the principles of CI are revision control,
automated testing, and build automation. The process is not known to get rid of
bugs but makes it easy to find and remove bugs. 

What CI Does?
Continuous Integration is a software development practice that integrates code
into a shared repository frequently. This is done by developers several times a day
each time they update the codebase. Each of these integrations can then be tested
automatically.
One of the main benefits of integrating regularly and testing each integration is
that you can detect errors more quickly and locate them easily. Since each
integration or update to codebase is usually small, pinpointing the exact change
that causes the error can be done quickly.
How CI Can be Used?
Over the past few years, Continuous Integration has become one of the best
practices for software development. The goal is to detect the errors early on
without having to wait until the end of the project.
Here are some basic prerequisites for implementing Continuous Integration: 
1. Automating builds
2. Automating testing
3. A single source code repository
4. Visibility of the entire process
5. Real-time code access to everyone in the team
For software development teams that don’t practice CI, they should start with
small steps instead of implementing the 
CI/CD (Continuous Integration/Continuous Development) pipeline immediately.
They should continuously iterate on code and process in a way that helps the
organization grow.
Importance of Continuous Integration
Continuous Integration enables better transparency and farsightedness in the process of software
development and delivery. It not only benefits the developers but all the segments of that company. These
benefits make sure that the organization can make better plans and execute them following the market
strategy. 
To understand the importance of CI, here are some of its benefits:
1. Reduces Risk
The frequent testing and deployment of code reduce the project's risk level, as now the code defects and bugs
can be detected earlier. This states that these bugs and errors can be easily fixed and take less time, making
the overall process cheaper. The general working speeds up the feedback mechanism that makes the
communication smoother and effective.
2. Better Communication
The Continuous Integration process collaborates with the Continuous Delivery workflow that makes code
sharing easy and regularized. This makes the process more transparent and collaborative among team
members. In the long term, this makes the communication speed more efficient and makes sure that everyone
in the organization is on the same page.
3. Higher Product Quality
Continuous Integration provides features like Code review and Code quality detection, making the
identification of errors easy. If the code does not match the standard level or a mistake, it will be alerted with
emails or SMS messages. Code review helps the developers to improve their programming skills continually.
4. Reduced Waiting Time
The time between the application development, integration, testing, and deployment is considerably reduced.
When this time is reduced, it, in turn, reduces the waiting time that may occur in the middle. CI makes sure
that all these processes continue to happen no matter what.
We came across three different terms, Continuous Integration, Continuous Deployment, and Continuous
Delivery. We must have a look at the difference between the three.
Benefits of Continuous Integration 
Risk Mitigation
The most important benefit of Continuous Integration is reduced risks in the
development process. When teams integrate consistently and frequently, they
significantly reduce the number of potential risks because they always know the
current state of the system.
Quality Teams
The software development teams have greater confidence in their work. They
know that the system can catch bugs and defects almost immediately, which
promises them a risk-free development process. 
Increased Visibility
A single repository and automated build provide full visibility for everyone
working on the project. This also allows them to coordinate and work on the issues
at hand before they turn into bigger problems.
Getting Started with Continuous Integration
While Continuous Integration should be done slowly, you may need to change
the entire team culture in order to fully implement it. Here are five steps to get
started with Continuous Integration:

1. Write tests for the most critical parts of the codebase


2. Run the tests automatically with a CI service on every push to the main
repository
3. Make everyone in the team integrate their changes every day
4. As soon as the build is broken, fix it
5. For every new story that is implemented, write a test
Continuous Integration vs Continuous Deployment vs Continuous Delivery 
All three are the phases of an automated release pipeline. These three processes
are responsible for taking the software from its first phase to the final phase.
Continuous Integration vs Continuous Deployment vs Continuous
Delivery 
Best Continuous Integration Tools and Services
The Optimized Pipeline Speed increases the execution speed that benefits other competitors and
provides a higher quality experience to the customers.
Organizations are continually moving towards DevOps methodologies to speed up the delivery
process and ensure product quality. Today, the companies have started realizing the importance of CI
and don't think twice about investing in it. 
Some of the third party tools that help in the management and installation of Continuous Integration
are as follows:  
What is Continuous Integration, Continuous Delivery and Continuous
Deployment?
What is Continuous Integration?
Continuous Integration (CI) is a DevOps software development practice that enables the developers
to merge their code changes in the central repository. That way, automated builds and tests can be
run. The amendments by the developers are validated by creating a built and running an automated test
against them. 
In the case of Continuous Integration, a tremendous amount of emphasis is placed on testing
automation to check on the application. This is to know if it is broken whenever new commits are
integrated into the main branch.
What is Continuous Delivery?
Continuous Delivery (CD) is a DevOps practice that refers to the building, testing, and delivering
improvements to the software code. The phase is referred to as the extension of the Continuous
Integration phase to make sure that new changes can be released to the customers quickly in a
substantial manner. 
This can be simplified as, though you have automated testing, the release process is also automated,
and any deployment can occur at any time with just one click of a button.
Continuous Delivery gives you the power to decide whether to make the releases daily, weekly, or
whenever the business requires it. The maximum benefits of Continuous Delivery can only be yielded if
they release small batches, which are easy to troubleshoot if any glitch occurs.
What is Continuous Deployment?
When the step of Continuous Delivery is extended, it results in the phase of Continuous Deployment.
Continuous Deployment (CD) is the final stage in the pipeline that refers to the automatic releasing of
any developer changes from the repository to the production. 
Continuous Deployment ensures that any change that passes through the stages of production is
released to the end-users. There is absolutely no way other than any failure in the test that may stop the
deployment of new changes to the output. This step is a great way to speed up the feedback loop with
customers and is free from human intervention. 
Features of Each Practice
Now, when you know the basics of all three practices, it is essential to understand why these practices
are adopted. Let's have a look at the benefits and factors of these practices, one after the other.
Continuous Integration 
Automated tests make sure that the bugs are captured in the early phases, and fewer bugs reach the
production phase. 
After the issues are resolved efficiently, it becomes easy to build the release.
Developers are alerted when they break any build, so they have to rebuild and fix the build before
moving forth on to the next task.
As Continuous Integration can run multiple texts within seconds, the costs for testing decreases
excessively.
When lesser time is invested in testing, more time can be spent in the improvement of quality.
Continuous Delivery
The process of deploying software is no more complex, and now the team does
not need to spend a lot of time preparing the release anymore.
The releases can be made more frequently, this in turn speeds up the feedback
loop with the customers.
The iterations in the case of the process become faster.
Continuous Deployment
There is no need to stop the development for releases anymore, as the entire deployment process is
now automated.
The release process is less prone to risks and is easily fixable in the case of any issues, as only the small
batches of changes are deployed.
There is a continuous chain of improvements in quality with every passing day. The process of
development now does not take long durations like a month or a year.
The process of Continuous Delivery and Continuous Deployment are often confused. This happens
because they both aim at automation and have certain things in common.
Continuous Delivery Vs. Continuous Deployment
There are many common things between the two practices, but there are differences that have quite an impact on the
business. 
Here, we shall see the contrast between the two phases based on the following three critical aspects.
Benefits of Continuous Integration & Continuous Delivery
Continuous Integration (CI) allows you to continuously integrate code into a single shared and easy to access repository.
Continuous Delivery (CD) allows you to take the code stored in the repository and continuously deliver it to production.
CI/CD creates a fast and effective process of getting your product to market before your competition as well as releasing
new features and bug fixes to keep your current customers happy.

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. These code changes are simpler and easier to handle than huge chunks of code and as such,
have fewer issues that may need to be repaired at a later date.
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. Limiting the scope of problems reduces the potential for damage and makes systems easier to maintain.

3. Faster Mean Time To Resolution (MTTR)


MTTR measures the maintainability of repairable features and sets the average time to repair a broken feature.
Basically, it helps you track the amount of time spent to recover from a failure.

4. More Test Reliability


Using CI/CD, test reliability improves due to the bite-size and specific changes introduced to the system, allowing for
more accurate positive and negative tests to be conducted. Test reliability within CI/CD can also be considered Continuous
Reliability. With the continuous merging and releasing of new products and features, knowing that quality was top of mind
throughout the entire process assures stakeholders their investment is worthwhile.
5. Faster Release Rate
Failures are detected faster and as such, can be repaired faster, leading to increasing release rates. However, frequent
releases are possible only if the code is developed in a continuously moving system.
6. Smaller Backlog
Incorporating CI/CD into your organization’s development process reduces the number of non-critical defects in your
backlog. These small defects are detected prior to production and fixed before being released to end-users.
7. Customer Satisfaction
The advantages of CI/CD do not only fall into the technical aspect but also in an organization scope. The first few
moments of a new customer trying out your product is a make-or-break-it moment.
8. Increase Team Transparency and Accountability
CI/CD is a great way to get continuous feedback not only from your customers but also from your own team. This
increases the transparency of any problems in the team and encourages responsible accountability.
9. 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. Doing so also frees up developer time that could be spent on product development as there aren’t as many
code changes to fix down the road if the error is caught quickly. Another thing to keep in mind: increasing code quality
with automation also increases your ROI.
10. Easy Maintenance and Updates
Maintenance and updates are a crucial part of making a great product. However, it’s important to note within a CI/CD
process to perform maintenance during downtime periods, also known as the non-critical hour. Don’t take the system
down during peak traffic times to update code changes.
Metrics to track CI/CD practices
DevOps organizations monitor their CI/CD pipeline across three groups of metrics:
1. Automation performance
2. Speed
3. Quality

With continuous delivery of high-quality software releases, organizations are able to respond to
changing market needs faster than their competition and maintain improved end-user experiences. How
can you achieve this goal?
CI/CD brief recap
But first, what is CI/CD and why is it important?
Continuous Integration (CI) refers to the process of merging software builds on a
continuous basis. The development teams divide the large-scale project into small
coding tasks and deliver the code updates iteratively, on an ongoing basis. The
builds are pushed to a centralized repository where further automation, QA, and
analysis takes place.

Continuous Delivery (CD) takes the continuously integrated software builds and


extends the process with automated release. All approved code changes and
software builds are automatically released to production where the test results
are further evaluated and the software is available for deployment in the real
world.
Deployment often requires DevOps teams to follow a manual governance process.
However, an automation solution may also be used to continuously approve
software builds at the end of the software development (SDLC) pipeline, making it
a Continuous Deployment process.
Metrics for optimizing the DevOps CI/CD pipeline
Agile CI/CD Pipeline
In regard to delivering high quality software, infusing performance and
security into the code from the ground up, developers should be able to write code
that is QA-ready.
DevOps organizations should introduce test procedures early during the SDLC
lifecycle—a practice known as shifting left—and developers should respond with
quality improvements well before the build reaches production environments.
DevOps organizations can measure and optimize the performance of their CI/CD
pipeline by using the following key metrics:
1. Test pass rate. The ratio between passed test cases with the total number of
test cases.
2. Number of bugs. The number of issues that cause performance issues at a
later stage.
3. Defect escape rate. The number of issues identified in the production stage
compared to the number of issues identified in pre-production.
4. Number of code branches. Number of feature components introduced into
the development project.
Automation of CI/CD & QA
Automation is the heart of DevOps and a critical component of a healthy CI/CD
pipeline. However, DevOps is not solely about automation. In fact, DevOps thrives
on automation adopted strategically—to replace repetitive and predictable tasks
by automation solutions and scripts.
Considering the lack of skilled workforce and the scale of development tasks in
a CI/CD pipeline, DevOps organizations should maximize the scope of their
automation capabilities while also closely evaluating automation performance.
They can do so by monitoring the following automation metrics:
1. Deployment frequency. Measure the throughput of your DevOps pipeline.
How frequently can your organization deploy by automating the QA and CI/CD
processes?
2. Deployment size. Does automation help improve your code deployment
capacity?
3. Deployment success. Do frequent deployments cause downtime and outages,
or other performance and security issues?
Infrastructure Dependability
DevOps organizations are expected to improve performance without disrupting the business.
Considering the increased dependence on automation technologies and a cultural change focused on
rapid and continuous delivery cycles, DevOps organizations need consistency of performance across the
SDLC pipeline.
Dependability of infrastructure underlying high performance CI/CD pipeline responsible for
hundreds (at times, thousands) of delivery cycles on a daily basis is therefore critical to the success of
DevOps. How do you measure the dependability of your IT infrastructure?
Here are a few metrics to get you started:
1. MTTF, MTTR, MTTD: Mean Time to Failure/Repair/Diagnose. These metrics quantify the risk
associated with potential failures and the time it takes to recover to optimal performance. Learn
more about reliability calculations and metrics for infrastructure or service performance.
2. Time to value. Another key metric is the speed of Continuous Delivery cycle release performance. It
refers to the time taken before a complete written software build is released into production. The
delaying duration may be caused by a number of factors, including infrastructure resources and
automation capabilities available to test and process the build, as well as the governance process
necessary for final release.
3. Infrastructure utilization. Evaluate the performance of every service node, server, hardware, and 
virtualized IT components. This information not only describes the computational performance
available for CI/CD teams but also creates vast volumes of data that can be studied for security and
performance issues facing the network infrastructure.

With these metrics reliably in place, you’ll be ready to understand how close to optimal you really are.

You might also like