0% found this document useful (0 votes)
22 views58 pages

DevOps Course Overview and Syllabus

This document outlines the course structure and objectives for a DevOps course (22CS910) offered by RMK Group of Educational Institutions, focusing on bridging development and operations through CI/CD pipelines, Docker, and Infrastructure as Code. It includes details on prerequisites, syllabus, course outcomes, and assessment methods, emphasizing the importance of automation in software delivery. Additionally, it highlights the benefits of CI/CD for faster deployments, including increased efficiency, reduced risk of defects, and quicker product delivery.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views58 pages

DevOps Course Overview and Syllabus

This document outlines the course structure and objectives for a DevOps course (22CS910) offered by RMK Group of Educational Institutions, focusing on bridging development and operations through CI/CD pipelines, Docker, and Infrastructure as Code. It includes details on prerequisites, syllabus, course outcomes, and assessment methods, emphasizing the importance of automation in software delivery. Additionally, it highlights the benefits of CI/CD for faster deployments, including increased efficiency, reduced risk of defects, and quicker product delivery.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Please read this disclaimer before proceeding:

This document is confidential and intended solely for the educational purpose of RMK
Group of Educational Institutions. If you have received this document through email in
error, please notify the system manager. This document contains proprietary information
and is intended only to the respective group / learning community as intended. If you
are not the addressee you should not disseminate, distribute or copy through e-mail.
Please notify the sender immediately by e-mail if you have received this document by
mistake and delete this document from your system. If you are not the intended
recipient you are notified that disclosing, copying, distributing or taking any action in
reliance on the contents of this information is strictly prohibited.
22CS910 - DevOps
Department : Computer Science & Engineering
Batch / Year : 2022 - 2026 / III
Created by : Mr. S Vijayakumar, Associate Professor / CSE
Date : 25.01.2025
1. Contents
S. No. Contents

1 Contents

2 Course Objectives

3 Prerequisites

4 Syllabus

5 Course Outcomes

6 CO-PO Mapping

7 Lecture Plan

8 Activity Based Learning

9 Lecture Notes

10 Assignments

11 Part- A Questions & Answers

12 Part-B Questions

13 Supportive Online Courses

14 Real Time Applications

15 Content beyond the Syllabus

16 Assessment Schedule

17 Prescribed Text books & Reference Books

18 Mini Project Suggestions


Content – Unit III
[Link]. Contents

1 Introduction to CI/CD pipelines

Introduction to CI/CD pipelines


2

3 Benefits of CI/CD for faster deployments

4 Benefits of CI/CD for faster deployments

5 Setting up a CI/CD pipeline with Jenkins

6 Setting up a CI/CD pipeline with Jenkins

7 Automating builds, tests, and deployments.

8 Automating builds, tests, and deployments.

9 Automating builds, tests, and deployments.


2. Course Objectives

The Course will enable learners to:

❖ Bridge the gap between development and operations for


faster, more reliable software releases.

❖ Automate software delivery with CI/CD pipelines.

❖ Package and deploy apps efficiently using Docker containers.

❖ Automate infrastructure with Infrastructure as Code (IaC).

❖ Monitor and troubleshoot applications in production.


3. Prerequisites

22CS910 - DevOps

22IT910
Rest Application Development Using Spring Boot and JPA

22CS402
Web Development Frameworks

22CS301
Advanced Java Programming

22CS202
Java Programming

22CS101 Problem Solving Using C++


22CS102 Software Development Practices
4. Syllabus
L T P C
22CS910 DevOps
3 0 0 3

OBJECTIVES:
The Course will enable learners to:
❖ Bridge the gap between development and operations for faster, more reliable
software releases.
❖ Automate software delivery with CI/CD pipelines.
❖ Package and deploy apps efficiently using Docker containers.
❖ Automate infrastructure with Infrastructure as Code (IaC).
❖ Monitor and troubleshoot applications in production.
UNIT I Introduction to DEVOPS 9

Software Development Methodologies - Operations Methodologies - Systems


Methodologies - Development, Release, and Deployment Concepts - Infrastructure
Concepts. What is DevOps? - DevOps importance and benefits -DevOps principles and
practices - 7 C’s of DevOps lifecycle for business agility - DevOps and continuous
testing. How to choose right DevOps tools? - Challenges with DevOps implementation.
UNIT II Version Control with GIT 9

Build production-grade applications – MYSQL - mapping Java classes to relational


database - Introduction to Git version control system - Git commands for basic
operations (clone, commit, push, pull) - Branching and merging strategies -
Collaboration using Git workflows.
UNIT III Continuous Integration and Delivery (CI/CD) 9

Introduction to CI/CD pipelines - Benefits of CI/CD for faster deployments - Setting up


a CI/CD pipeline with Jenkins - Automating builds, tests, and deployments.
UNIT IV Containerization with Docker 9

Introduction to containerization and its benefits - Understanding Docker concepts:


images, containers, registries - Building and managing Docker containers - Docker
Compose for multi- container applications - Introduction to container orchestration with
Docker Swarm or Kubernetes.
UNIT V Infrastructure as Code (IaC) and Monitoring 9

Introduction to Infrastructure as Code (IaC) - Benefits of using IaC for repeatable


infrastructure provisioning - Learning IaC with Terraform - Setting up infrastructure
configurations with Terraform - Introduction to monitoring and logging tools for
applications - Alerting and troubleshooting techniques.
TOTAL: 45 PERIODS
4. Syllabus Contd...
OUTCOMES:
Upon completion of the course, the students will be able to:
CO1: Understand the core principles and philosophies of DevOps.
CO2: Implement version control systems for code management and collaboration.
CO3: Automate software delivery pipelines using CI/CD tools.
CO4: Utilize containerization technologies for packaging and deploying applications.
CO5: Configure infrastructure as code (IaC) for repeatable deployments.
CO6: Monitor and maintain applications in a production environment.
TEXTBOOKS:
1. Deepak Gaikwad, Viral Thakkar, "DevOps Tools: from Practitioner's Point of View",
Wiley, 2019.
2. Jennifer Davis, Ryn Daniels, "Effective DevOps", O'Reilly Media, 2016.
REFERENCES:
1. Gene Kim, Jez Humble, Patrick Debois, "The DevOps Handbook: How to Create
World-Class Agility, Reliability, and Security in Technology Organizations", IT
Revolution Press, 2016.
2. Jez Humble, Gene Kim, "Continuous Delivery: Reliable Software Releases Through
Build, Test, and Deployment Automation", Addison-Wesley, 2010.
3. Yevgeniy Brikman, "Terraform: Up & Running: Writing Infrastructure as Code",
O'Reilly Media, 2019.
4. Joseph Muli, "Beginning DevOps with Docker", Packt Publishing, 2018.
5. Course Outcomes
Upon completion of the course, the students will be able to:

CO1: Understand the core principles and philosophies of DevOps.

CO2: Implement version control systems for code management and

collaboration.

CO3: Automate software delivery pipelines using CI/CD tools.

CO4: Utilize containerization technologies for packaging and deploying

applications.

CO5: Configure infrastructure as code (IaC) for repeatable deployments.

CO6: Monitor and maintain applications in a production environment.


6. CO - PO Mapping
POs and PSOs

PO PO PO PO PO PO PO PO PO PO PO PO PS PS PS
COs 1 2 3 4 5 6 7 8 9 10 11 12 O1 O2 O3

CO1 3 3 3 2 2 2 1 1

CO2 3 3 3 2 2 2 1 1

CO3 3 3 3 2 2 2 1 1

CO4 3 3 3 2 2 2 1 1

CO5 3 3 3 2 2 2 1 1
7. Lecture Plan - Unit III
No.
S. of Proposed Actual Pertaining Taxonomy Mode of
Topic
No. Period Date Lecture CO Level Delivery
s Date

Introduction to CI/CD
1 CO3 Chalk &
pipelines 1 K2
Talk

Introduction to CI/CD
2 1 CO3 Chalk &
pipelines K3
Talk

Benefits of CI/CD for


1 CO3 Chalk &
3 faster deployments K3
Talk

Benefits of CI/CD for


4 1 CO3 Chalk &
faster deployments K2
Talk

Setting up a CI/CD
5 1 CO3 Chalk &
pipeline with Jenkins K3
Talk

Setting up a CI/CD
6 1 CO3 Chalk &
pipeline with Jenkins K3
Talk

Automating builds,
7 tests, and 1 CO3
K2
Chalk &
deployments. Talk

Automating builds,
8 tests, and 1 CO3
K3
Chalk &
deployments. Talk

Automating builds,
9 tests, and 1 CO3
K2
Chalk &
deployments. Talk
8. Activity Based Learning
Learning Method Activity

Tutorial Sessions available in


Learn by Solving Problems
RMK Nextgen

Quiz / MCQ Using RMK Nextgen


Learn by Questioning
App

Practice available in RMK


Learn by doing Hands-on
Nextgen
9. Lecture Notes
Continuous Integration and Delivery (CI/CD)
Introduction to CI/CD pipelines - Benefits of CI/CD for
faster deployments - Setting up a CI/CD pipeline with
Jenkins - Automating builds, tests, and deployments.
3.1 Introduction to CI/CD pipelines
A CI/CD pipeline is a series of automated steps that help software
development teams create, test, and deploy applications. CI/CD stands for
continuous integration and continuous delivery or deployment.
By automating CI/CD throughout development, testing,
production, and monitoring phases of the software development lifecycle,
organizations are able to develop higher quality code, faster and more
securely. Although it’s possible to manually execute each of the steps of a
CI/CD pipeline, the true value of CI/CD pipelines is realized through
automation.

CI/CD pipeline
A pipeline is a process that drives software development through
a path of building, testing, and deploying code, also known as CI/CD. By
automating the process, the objective is to minimize human error and
maintain a consistent process for how software is released. Tools that are
included in the pipeline could include compiling code, unit tests, code
analysis, security, and binaries creation. For containerized environments, this
pipeline would also include packaging the code into a container image to be
deployed across a hybrid cloud.
CI/CD is the backbone of a DevOps methodology, bringing
developers and IT operations teams together to deploy software. As custom
applications become key to how companies differentiate, the rate at which
code can be released has become a competitive differentiator.
From merging codes to testing builds, continuous integration
(CI) validates all the stages of the development process while optimizing
the code release cycles through automation capabilities. This, in turn,
minimizes the probability of extended feature development cycles and
related issues like merge conflicts.
Continuous deployment (CD) focuses on setting up a bundled
artifact into a production environment in the fastest way possible. It
automates the whole distribution process, including deployment.

Developers frequently commit codes to version control systems


such as GitHub, which start the CI process. The code quality can be
determined by scanning or analyzing it with static code analysis tools. The
CI process creates the final build after running automated tests, such as
unit and integration tests.
Implementing CI is the first essential step for a developer to
create high-quality code. Several CI tools are available, including Harness
CI, CircleCI, and Travis CI. Code changes are deployed automatically into
production in the final stage of the CI/CD pipeline once the build has
passed all tests.
The technical purpose of CI is to create a standardized and
automated process for developing, packaging, and testing programs.
Most developer teams are inclined toward code changes when
the integration process achieves better cooperation and software quality.
On the other hand, the CD begins where CI ends to ensure that the code
changes are automatically pushed to the selected infrastructure
environments.
CI/CD refers to a pipeline where you can submit new code on
one end, let it get tested through phases such as sourcing, building,
staging, and production, and then finally release it as a ready-for-
production code.
In the CI/CD pipeline, each stage serves as a gate that verifies
a specific feature of the code. The premise is that, as the code travels
through the pipeline, its quality will improve since developers will check
more aspects of it. Early-stage problems prevent the code from advancing
through the channel. Results of these tests are promptly communicated. If
the software fails a stage, all subsequent builds and releases are halted.
These steps are only recommendations and can be changed based on the
organization’s requirements. You can also repeat the steps for testing,
security, performance, and other reasons. Also, one can make changes at
different levels based on a particular project.
3.2 Benefits of CI/CD for faster deployments
Companies attempt to deploy features as quickly as possible to
stay competitive in the market. A seamless CI/CD pipeline is the perfect
platform for such short release cycles. The pipeline comprises
several DevOps automation tools and frameworks that assist developers,
testers, operations teams, and other project participants in delivering
software to end-users.
This allows the teams to be more agile while also improving the
overall efficiency of the software delivery process. The groundwork for
creating a pipeline might take a long time and may need a high learning
curve, but the advantages far outweigh the time, expense, and effort
required.
Benefits of CI/CD for faster deployments
1. Higher efficiency
Increased productivity is one of the leading advantages of a CI/CD pipeline.
You should automate your process if you have a review process that
includes deploying code to development, testing, and production
environments and entering multiple commands across several domains. This
creates the need for a CI/CD framework.

2. Reduced risk of defects


Finding and resolving defects late in the development process is costly and
time-consuming. This is particularly true when problems arise with features
already released to production.
You can test and deploy code more frequently using a CI/CD pipeline, giving
QA engineers the power to identify and fix errors as soon as they occur. This
way, you’re effectively mitigating risks in real-time.

3. Faster product delivery


With a smooth CI/CD workflow, multiple daily releases can
become a reality. Teams can automatically build, test, and deliver features
with minimal manual intervention. Docker, Kubernetes, and Travis CI are
some of the tools and frameworks that can be used to accomplish this.
CD enables your team to provide customers with frequent and
timely updates. When CI/CD is used, the entire team’s efficiency increases,
including the release of new features and fixes to problems.
Businesses can address
Market shifts, security challenges, consumer needs, and financial pressures
faster.
4. Quick rollback if required
One of the most exclusive benefits of a CI/CD pipeline is that it leads to the
quick and easy rollback of code changes if there are any issues in the
production environment after a release. If any new code change breaks a
feature or general application, you can revert to its previous stable version
right away. You can deploy the most recent successful build instantly to
avoid production interruptions.
5. Better planning
Organizational designs must be adaptable to changing economic conditions.
However, it’s difficult for development and testing teams to adapt to rapid ch
anges in dynamic business conditions. A CI/CD
pipeline enables organizations to accomplish this by ensuring that they
have a well–organized surplus
of items and a continuous line of communication with clients.
7. Efficient Testing & Monitoring
Testing entails automating each test case and experimenting with the
program. Any cycle that needs to be repeated over time should be
automated, and there are enough innovations available to achieve this goal.
Manual testing measures must be evaluated for possible automation
outcomes, and in the vast majority of circumstances, there will be ways to
automate the equivalent.
8. Cost-effectiveness
The CI/CD pipeline takes a different approach to software delivery. It can be
compared to an assembling unit’s delivery pipeline. In any business
situation, time and assets are essential. Firms are expected to respond to
client demands quickly and effectively with such requirements.
With automated testing hooks at every stage, developers can fix issues early
and avoid critical issues in the production environment. With the
implementation of a CI/CD pipeline, code quality improves drastically, which,
in turn, improves the overall ROI.
3.3 Setting up a CI/CD pipeline with Jenkins
Introduction
Jenkins is a popular open-source automation server that enables
developers to build, test, and deploy their software. It is primarily used for
implementing CI/CD workflows, also known as pipelines.
Jenkins is written in Java and can be used in conjunction with
various testing and reporting tools. It offers a simple way to set up a CI/CD
environment for almost any combination of code languages and source code
repositories using pipelines. It integrates with practically every tool in the
DevOps toolchain.
Jenkins is flexible and can be hosted on-premise or in the cloud,
making it a suitable choice for different types of projects. Can run on
different operating systems, including Windows, macOS, and various flavors
of Unix such as Ubuntu, OpenSUSE, and more.
Jenkins Pipeline
A Jenkins pipeline is a suite of Jenkins features that supports
implementing and integrating continuous delivery pipelines into our software
delivery process. A pipeline has an extensible automation server where
creating, testing, and deploying software happens continuously.
In a Jenkins pipeline, every job or event has mainly two parts.
The first part is the stages, which comprises various steps like build, test,
deploy, etc. The second part is a post-section that executes operations
depending on the outcome of the stages.
T he pipeline feature turns complicated build process into a
manageable and easy-to-understand script with the help of a domain-specific
language (DSL). This DSL is based on Groovy, which is a powerful, optionally
typed, and dynamic language that runs on the Java platform.
How to Create a CI/CD Pipeline with Jenkins ?
Step 1: Download and Install Jenkins
The first step is to download and install Jenkins on your local machine.
Jenkins is a Java-based application, so you’ll need to have Java installed on
your machine as a prerequisite.
To download Jenkins, visit the official Jenkins website and navigate to
the Download section. Choose the version that suits your operating system
(Windows, Linux, MacOS), and download the ‘war’ file. Save this file in a
directory of your choice.
After downloading the Jenkins ‘war’ file, you can install Jenkins by executing
the ‘war’ file using the Java Runtime Environment. Open your terminal,
navigate to the directory where you saved the ‘war’ file, and run the
following command:
java -jar [Link]
Step 2: Start and Configure Jenkins
To start Jenkins, access it via your browser by navigating to
[Link]
If Jenkins has started successfully, you should see a setup wizard.
The setup wizard will guide you through the initial configuration
of Jenkins. It will ask you for the initial admin password, which you can find
in the terminal output or in a file named initialAdminPassword in the
Jenkins home directory.
Next, you’ll be asked to install suggested plugins or select specific
plugins to install. For this tutorial, let’s go with the suggested plugins. Jenkins
will then proceed to install these plugins, which may take a while.
After the plugins are installed, you’ll be prompted to create your first admin
user. Fill in the necessary details and click Save and Continue. Finally,
confirm the Jenkins URL (which should be [Link]
if you’re running Jenkins locally), and click Save and Finish.
Step 3: Create CI/CD Pipeline in Jenkins
Now that we have Jenkins up and running, it’s time to create our
first CI/CD pipeline. A pipeline in Jenkins defines an entire application life
cycle as a code. It describes the steps that need to be undertaken from the
moment the code is committed to a version control system until it’s deployed
to production.
To create a pipeline, navigate to the Jenkins dashboard, and click
on New Item in the top left corner. Provide a name for your pipeline,
select Pipeline as the type, and click OK.
In the configuration screen, select Advanced Project Options. Here, in
the Pipeline section, you’ll define your pipeline script. You can either write
the script directly in the Script box or load it from a Jenkinsfile
in your project repository.
A basic pipeline script might look like this:
pipeline {
agent any
stages {
stage('Build') {
steps {
echo 'Building..'
}
}
stage('Test') {
steps {
echo 'Testing..'
}
}
stage('Deploy') {
steps {
echo 'Deploying....'
}
}
}
}
This script defines a pipeline with three stages: Build, Test, and Deploy. Each
stage contains a step that echoes a message to the console.
3.4 Automating builds
Automating a build in a CI/CD process means setting up a system
where the process of compiling and creating an executable version of your
software is automatically triggered whenever code changes are committed to
a repository, allowing for rapid feedback and early detection of issues
through automated testing, all within a continuous integration and delivery
pipeline.
Key points about automating builds in CI/CD:
Continuous integration:

The core concept where code changes are frequently merged into a shared
repository, triggering an automated build process to check for integration
issues.
Automated testing:

An integral part of the build process, where various test suites (unit,
integration, regression) are automatically executed to validate the code
changes.
Fast feedback loop:

The automated build and testing process provides quick feedback to


developers, allowing them to identify and fix bugs early in the development
cycle.

CI/CD tools:

Specialized platforms like Jenkins, GitLab CI, GitHub Actions, etc., are used
to configure and manage the automated build and testing pipelines.
How to automate build in CI/CD:
Set up version control:

Store your code in a centralized repository like Git, which will trigger the
build process on commits.
Configure build scripts:

Write scripts that define the build steps (compiling, packaging, etc.) using
the chosen CI/CD tool.
Integrate automated tests:

Add your test suite into the build pipeline to run automatically after the build
is complete.
Define build stages:

Break down the build process into logical stages (e.g., code checkout,
compilation, testing, deployment) for better management.

Benefits of automating builds in CI/CD:


Early bug detection:

Identifying issues early in the development cycle by running tests


immediately after code changes.
Improved code quality:

Frequent integration and testing help maintain a high standard of code


quality.
Faster delivery:

Streamlining the build process enables quicker release cycles.


Reduced manual effort:
Automating repetitive tasks frees up developers to focus on more complex
problems.
Maintains a Complete History
Build automation maintains a complete history of files and changes. That
means you’ll be able to track issues back to their source.
Saves Time and Money
Build automation saves time and money. That’s because build automation
sets you up for CI/CD, increases productivity, accelerates delivery, and
improves quality.
How to Automate the Build Process?
Steps to automate the build process:
1. Write the code.
2. Commit code to a shared, centralized repository — such as Perforce
Helix Core.
3. Scan the code using tools such as static ana lysis.
4. Start a code review.
5. Compile code and files.
6. Run automated testing.
7. Notify contributors to resolve issues.
3.5 Automating tests
Automating tests in a CI/CD process means integrating
automated testing tools within your continuous integration and continuous
delivery pipeline, allowing for automatic execution of tests on every code
change, providing immediate feedback on software quality and identifying
potential issues early in the development cycle.
Role of Automation Testing in CI/CD
Automation enables meaningful and effective implementation of
CI/CD. Automation Testing is at the core of any CI/CD pipeline. This is
because the whole concept of CI/CD revolves around “build fast, test fast,
fail fast.”
Tests have to be run as fast as possible so that the feedback
reaches the developer early. This enables the early detection of bugs. As a
result, the product that goes out to the release stage will be more accurate
and bug-free. All this will only be possible with the automation of test suites.

Test automation offers the following advantages:

1. Reduces manual efforts when the same test must be run repetitively.
This frees up more time to perform rigorous manual tests.
2. Gives immediate feedback.
3. Tests can be more accurate and cover more test cases.
4. Helps generate and compare multiple test results, ensuring product
consistency.
5. Becomes an integral part of the CI/CD pipeline, abiding with its principle
of build fast, fail fast.
Key points about automating tests in CI/CD:
Early bug detection:

By running tests automatically with every code commit, bugs are caught as
soon as they are introduced, allowing for faster fixes and improved overall
quality.
Shift-left testing:

This approach moves testing further left in the development lifecycle,


enabling developers to identify and fix issues while writing code, rather than
waiting until later stages.
Faster feedback loop:

Automated tests provide rapid feedback to developers, allowing them to


quickly iterate on code and address issues promptly.
Repetitive task automation:
Automated tests eliminate the need for manual test execution, freeing up QA
teams to focus on more complex testing scenarios.

Types of tests typically automated in CI/CD:

Unit tests: Tests individual code units (functions, classes) to verify their
functionality.
Integration tests: Verify how different components of the system interact
with each other.
Regression tests: Ensure that new code changes don't break existing
functionality.
UI tests: Validate the user interface elements and interactions.
API tests: Test the functionality of application programming interfaces.
How to implement automated testing in CI/CD:
Choose a testing framework:

Select a framework compatible with your programming language and testing


needs (e.g., JUnit, pytest, Selenium).
Integrate with CI/CD tool:

Configure your chosen CI/CD platform (Jenkins, GitHub Actions, CircleCI) to


trigger automated tests on code commits.
Write test scripts:

Develop automated test cases covering critical functionalities of your


application.
Test execution and reporting:
Set up the CI/CD pipeline to execute tests automatically and generate
detailed reports on test results.

Benefits of automated testing in CI/CD:

Improved software quality: Early detection of bugs leads to higher


quality software releases.
Faster development cycles: Automated tests enable rapid feedback loops,
accelerating development process.
Increased team efficiency: QA teams can focus on more strategic testing
activities.
Reduced costs: Early bug detection minimizes the cost of fixing issues later
in the development cycle.

.
3.6 Automating deployments
Automating deployments in a CI/CD (Continuous
Integration/Continuous Delivery) process means using tools and scripts to
automatically move new code changes through the development lifecycle,
from building and testing to deploying them to production environments,
eliminating the need for manual intervention and ensuring consistent, rapid
releases.

Key aspects of automated deployments in CI/CD:


Continuous Integration:

When developers commit code changes to a shared repository,


automated builds and tests are triggered to verify the code's integrity and
catch potential issues early on.
Continuous Delivery:

If the code passes tests in the CI stage, it is automatically


prepared for deployment to various environments like staging or production,
often with the ability to manually approve before going live.
Deployment Pipeline:
A defined series of steps within the CI/CD tool that automates the
deployment process, including provisioning servers, deploying application
artifacts, configuring environment variables, and running post-deployment
checks.
Benefits of automating deployments:
Faster Time to Market:
New features and bug fixes can be delivered to users quickly and frequently.
Improved Quality:
Automated tests at every stage help identify issues early on, leading to higher
quality software.
Reduced Manual Effort:
Eliminates the need for manual deployment steps, freeing up developer time.
Consistency:
Ensures deployments are performed in a standardized way across different
environments.

Common tools used for automated deployments in CI/CD:

Jenkins: A widely used open-source CI/CD server that allows you to create
custom pipelines for building, testing, and deploying applications.
GitLab CI/CD: Built-in CI/CD features within GitLab that integrate
seamlessly with the version control system.
GitHub Actions: A native CI/CD solution within GitHub for automating
workflows.
AWS CodePipeline: A managed CI/CD service offered by Amazon Web
Services
Azure DevOps Pipelines: A similar service provided by Microsoft Azure
Typical stages in a CI/CD deployment pipeline:
Build: Compiling source code into executable artifacts
Unit Tests: Running automated tests to verify individual code units
Integration Tests: Testing how different components of the application work
together
Staging Deployment: Deploying the application to a staging environment for
further testing and user feedback
Production Deployment: Deploying the application to the live production
environment
10. Assignment Questions
[Link] K-
Topic COs
. Level
How to create CI / CD Pipeline Jenkins ,
1 Implement Step by Step to illustrate the K3 CO3
process.

How to setup CI CD pipeline for automation


2 K3 CO3
testing?
11. Part A
Question & Answer
Part A
1. What is CI/CD? (CO3, K1)

CI/CD stands for continuous integration and continuous delivery


(or deployment). It's a set of practices that automate the software
development process to make it faster and more efficient.

2. What’s the difference between continuous integration,


continuous delivery, and continuous deployment? (CO3, K3)

Continuous integration (CI) executes the sequence of steps required


to build and test the project. CI runs automatically on every change
committed to a shared repository, offering developers quick feedback
about the project’s state.

Continuous delivery is an extension of CI. Its goal is to automate every


step required to package and release a piece of software. The output of a
continuous delivery pipeline takes the form of a deployable binary,
package, or container.

Continuous deployment is an optional step-up from continuous


delivery. It is a process that takes the output from the delivery pipeline
and deploys it to the production system in a safe and automated way.
3. Is CI / CD different from DevOps? (CO3, K3)

CI/CD vs. DevOps. CI/CD refers to a set of development


practices that enable the rapid and reliable delivery of code changes,
while DevOps is a collection of ideas, practices, processes, and
technologies that allow development and operations teams to work
together to streamline product development.
Part A
4. Is GitHub a CICD tool?(CO3, K1)

At its core, GitHub Actions is designed to help simplify


workflows with flexible automation and offer easy-to-use CI/CD
capabilities built by developers for developers. Compared with other
automation or CI/CD tools, GitHub Actions offers native capabilities right
in your GitHub flow.

5. Which CI CD tool is best?(CO3, K3)

 Gitlab CI/CD. GitLab CI/CD is a software development platform that


uses Continuous methodologies, such as Continuous Integration,
Delivery, and Deployment.
 Azure DevOps. Azure DevOps is a cloud service that automatically
builds and tests your code.
 GitHub Actions.
 CircleCI.
 Jenkins.
 Travis CI.
 Bitbucket Pipeline.
 TeamCity.

6. Which language is best for CI CD? (CO3, K3)

Python makes it straightforward to develop scripts that


automate the CI/CD workflow, making it more efficient and error-free.
Remember that the most important and well-known DevOps tools are
built in Python; examples include Ansible and SaltStack.
Part A
7. What is Jenkins used for? (CO3, K1)

Jenkins is an open source continuous integration (CI) server.


It manages and controls several stages of the software delivery process,
including build, documentation, automated testing, packaging, and static
code analysis. Jenkins is a highly popular DevOps tool used by thousands
of development teams At its core, GitHub Actions is designed to
help simplify workflows with flexible automation and offer easy-to-use
CI/CD capabilities built by developers for developers. Compared with
other automation or CI/CD tools, GitHub Actions offers native capabilities
right in your GitHub flow.

8. How do CI and version control relate to one another? ? (CO3,


K1)

Every change in the code must trigger a continuous integration


process. This means that a CI system must be connected with a Git
repository to detect when changes are pushed, so tests can be run on the
latest revision.

9. Name some benefits of CI/CD. (CO3, K1)

 Less risk: automated tests reduce the chance of introducing bugs,


creating a safety net that increases the developer’s confidence in
their code.

 More frequent releases: the automation provided by continuous


delivery and continuous deployment allows developers to release and
deploy software safely many times per day.

 Improved productivity: freed from the manual labor of building


and testing the code, developers can focus on the creative aspects of
coding.
Part A
 Elevated quality: CI acts as a quality gate, preventing code that is
not up to standards from getting released.

 Better design: the iterative nature of continuous integration lets


developers work in small increments, allowing a higher degree of
experimentation, which leads to more innovative ideas.

10. What are the most important characteristics in a CI/CD


platform? . (CO3, K1)

 Reliability: the team depends on the CI server for testing and


deployment, so it must be reliable. An unreliable CI/CD platform can
block all development work.

 Speed: the platform should be fast and scalable to obtain results in a


few minutes.

 Reproducibility: the same code should always yield the same


results.

 Ease of use: easy to configure, operate, and troubleshoot.

11. What is the build stage? (CO3, K1)

The build stage is responsible for building the binary, container,


or executable program for the project. This stage validates that the
application is buildable and provides a testable artifact.
Part A
12. How does testing fit into CI? (CO3, K2)

Testing is integral to and inseparable from CI. The main benefit teams get
from CI is continuous feedback. Developers set up tests in the CI to check
that their code behaves according to expectations. There would be no
feedback loop to determine if the application is in a releasable state
without testing.

13 Should testing always be automated? (CO3, K3)

Yes, CI requires that all tests are automated. They must work without
human intervention.

That is not to say that manual or exploratory testing don’t have their
places. They are very useful for discovering potential features and finding
further test cases to automate.

14. Name a few types of tests used in software development


(CO3, K1)

There are more types of tests than we can count with both hands, but the
most common ones are:

Unit tests: validate that functions or classes behave as expected.

Integration tests: are used to verify that the different components of


an application work well together.

End-to-end tests: check an application by simulating user interaction.

Static tests: finds defects in code without actually executing it.

Security tests: scans the application’s dependencies for known security


issues.

Smoke tests: fast tests that check if the application can start and that
the infrastructure is ready to accept deployments.
Part A
15. What is test coverage? (CO3, K1)

Test coverage is a metric that measures how much of the codebase is


covered by tests. A 100% coverage means that every line of the code is
tested at least by one test case.

16. Does CI/CD require any programming knowledge? (CO3, K2)

As far as CI/CD goes, it does not require any programming


language or scripting language to be used. It is not necessary to use any
programming or scripting language when you use a GUI-based tool like
Azure DevOps (ADO). The use of ARM templates in Azure DevOps
requires scripting knowledge. Therefore, it depends on the tools and
different ways of setting up CI/CD.

17. What is a CI/CD Engineer? (CO3, K1)

CI/CD engineers can improve the integration and operation of


CI/CD tools as well as ensure quality end-to-end integration systems.
CI/CD Engineers would keep teams motivated and lead the charge on
CI/CD. It is the CI/CD engineer's responsibility to ensure that CI/CD tools
and platforms are functioning correctly within an organization. CI/CD
engineers understand how to optimize their teams' development and
release processes.

18. Explain the benefit of the CI/CD Pipeline. (CO3, K3)

CI/CD brings certain benefits to your organization that will help you
decide whether to go ahead with it. Below are some of these benefits:

CI/CD makes it possible to quickly integrate small code changes and test
the changes easily.
Part A
With CI/CD setup, fault isolation is easier and faster. In fault isolation, the
system is monitored, the fault occurrence time is determined, and the
fault location is determined.

With CI/CD, MTTR (mean time to resolution) is reduced since changes are
smaller and easier to implement. CI/CD setup increases the reliability of
the unit and integration testing.

When CI/CD is set up, small code changes are merged very quickly and
the code is ready for production very soon.

CI improves transparency by detecting early-stage failures like build


failures, merge issues, integration test failures, etc.

CD facilitates the release of code to end-users.

19. How Do You Ensure Security in a CI/CD Pipeline? (CO3, K3)

Security is a crucial aspect of the CI/CD process. Key practices include:

Code Analysis: Implement static code analysis tools to detect


vulnerabilities.

Secrets Management: Use tools like HashiCorp Vault or AWS Secrets


Manager to manage sensitive information securely.

Access Control: Implement role-based access control (RBAC) to restrict


permissions.

Security Testing: Integrate security testing tools like OWASP ZAP to


identify potential vulnerabilities.
Part A
20. How Do You Monitor and Maintain a CI/CD Pipeline? (CO3,
K3)

Monitoring and maintaining a CI/CD pipeline is crucial for ensuring


smooth operation. Key practices include:

 Monitoring Tools: Use tools like Prometheus, Grafana, and ELK


stack to monitor metrics and logs.

 Alerting: Set up alerts for failures or performance issues.

 Regular Audits: Conduct regular audits of the pipeline to identify


and address inefficiencies.

 Documentation: Maintain clear documentation of the pipeline’s


structure and processes.
[Link] – B Questions
1. Explain in detail about CI / CD. (CO3, K2)
2. Explain CI/CD pipelines with neat diagram. (CO3, K2)
3. Discuss about thw Benefits of CI/CD for faster deployments. (CO3,
K2)
4. Illustrate the steps in Setting up a CI/CD pipeline with Jenkins. (CO3,
K2)
5. Describe about Automating builds in Detail. (CO3, K2)
6. Describe about Automating tests in Detail. (CO3, K2)
7. Describe about Automating deployments in Detail. (CO3, K2)

Note : All the above questions requires Diagrams to Illustrate the Concepts, Wherever
Necessary.
13. Supportive online courses

Online Courses
1. [Link]
continuous-delivery-ci-cd

2. [Link]

3. [Link]

External Links for Additional Resources

1. [Link]

2. [Link]
delivery-ci-cd-with-gitlab

3. [Link]
14. Real Time Applications
Real Time CI/CD Pipeline for Java Application to Deploy on Apache Server.

In today’s fast-paced software development environment,


Continuous Integration and Continuous Deployment (CI/CD) pipelines have
become essential tools for delivering high-quality software efficiently.
CI/CD pipelines automate the process of building, testing, and
deploying code changes, enabling developers to release updates quickly and
reliably. By integrating CI/CD into your development workflow, you can
improve collaboration, increase code quality, and accelerate time-to-market.
For Java applications, setting up a CI/CD pipeline involves
configuring tools and scripts to automatically build the application, run tests,
and deploy the artifacts to a server environment. In this tutorial, we’ll leverage
popular CI/CD tools such as Jenkins, Maven, and Apache Maven to create a
robust pipeline for a Java application.
15. Content Beyond Syllabus
CI/CD Best Practices: Tools, Processes, and Real-World
Examples
Continuous Integration (CI) and Continuous Delivery (CD)
are cornerstones of modern software development. Implementing
CI/CD pipelines effectively ensures that code changes are
automatically tested, integrated, and deployed, leading to faster
development cycles and more reliable software. In this blog post, we’ll
explore best practices for CI/CD, the tools you can use, and real-world
examples of successful pipelines.
What is CI/CD?
Continuous Integration (CI) is the practice of automatically
integrating code changes from multiple contributors into a shared
repository several times a day. CI involves running automated tests to
catch bugs early in the development process.
Continuous Delivery (CD) extends CI by automating the
release process, ensuring that code changes can be deployed to
production at any time. CD aims to reduce the friction between
development and operations, enabling frequent and reliable releases

CI/CD Best Practices


One of the primary goals of CI/CD is automation. Automating the
build, test, and deployment processes ensures consistency, reduces
human error, and speeds up development cycles.
15. Content Beyond Syllabus
1. Automated Testing:
Implement unit tests, integration tests, and end-to-end
tests to ensure code quality.
Automated Deployments: Use tools like Jenkins, GitLab CI, or GitHub
Actions to automate the deployment process, ensuring that new
features or bug fixes are deployed quickly and safely.
2. Keep Builds Fast
Speed is essential in CI/CD. Long build times can slow
down the development process and reduce productivity.
Parallel Builds: Use parallelization to run multiple build processes
simultaneously.
Incremental Builds: Only rebuild parts of the application that have
changed to save time.
3. Test in Production-Like Environments
To ensure that your code works as expected in production,
it’s crucial to test in environments that closely resemble production.
Staging Environments: Deploy to a staging environment that
mirrors production before pushing to live.
Feature Flags: Use feature flags to test new features in production
without exposing them to all users.
4. Implement Trunk-Based Development
Trunk-based development involves keeping branches
short-lived and merging code into the main branch (trunk) frequently.
This practice reduces merge conflicts and keeps the codebase clean
and manageable.
Short-Lived Branches: Aim to merge branches within a day or two
to minimize divergence.
15. Content Beyond Syllabus
Frequent Commits: Commit and integrate code changes frequently to
catch issues early.
5. Monitor and Rollback
Monitoring your CI/CD pipeline and applications in
production is critical for identifying issues quickly.
Monitoring Tools: Use monitoring tools like Prometheus, Grafana, or
New Relic to track the health of your applications and pipeline.
Rollback Mechanisms: Implement rollback mechanisms to revert to
a previous stable version if something goes wrong in production.

Popular CI/CD Tools


1. Jenkins
Jenkins is an open-source automation server widely used
for building, testing, and deploying code. Its flexibility and extensive
plugin ecosystem make it a popular choice for CI/CD pipelines.
Plugins: Jenkins offers plugins for almost any CI/CD need, from
version control to deployment.
Pipeline as Code: Define your CI/CD pipeline in a Jenkinsfile, making
it easier to version and maintain.
2. GitLab CI/CD
GitLab CI/CD is integrated into GitLab, providing a
seamless experience for developers. It supports a wide range of
languages and frameworks and allows you to define your CI/CD
pipeline using a .[Link] file.
Auto DevOps: GitLab CI/CD includes Auto DevOps, which
automatically detects your project’s language and configures a CI/CD
pipeline for you.
15. Content Beyond Syllabus
Built-in Security Scanning: GitLab provides built-in security scanning
tools to identify vulnerabilities in your code.
3. GitHub Actions
GitHub Actions is GitHub’s native CI/CD tool, allowing you
to automate workflows directly from your repository. It’s highly
customizable and integrates seamlessly with GitHub’s ecosystem.
Marketplace: GitHub Actions offers a marketplace with pre-built
actions for various CI/CD tasks.
Custom Workflows: Define custom workflows in a
.github/workflows/ directory, enabling you to automate any aspect of
your development process.
4. CircleCI
CircleCI is a cloud-based CI/CD tool that offers fast,
scalable builds and deployments. It integrates with GitHub and
Bitbucket and provides powerful configuration options via [Link].
Custom Executors: CircleCI allows you to define custom Docker
images for your build environment, ensuring consistency across builds.
Orbs: Reusable snippets of CircleCI configuration, called Orbs, help
you share common tasks across projects.

Real-World Examples of Successful CI/CD Pipelines


1. Netflix
Netflix has one of the most sophisticated CI/CD pipelines
in the industry. They employ a microservices architecture with
continuous delivery to ensure new features and updates are deployed
rapidly and without downtime.
15. Content Beyond Syllabus
Simian Army: Netflix uses a suite of tools called Simian Army to test
the resilience of their systems in production.
Canary Deployments: Netflix employs canary deployments to release
updates to a small subset of users before rolling them out to
everyone.
2. Facebook
Facebook’s CI/CD pipeline is designed to handle rapid
development and deployment cycles, with thousands of engineers
committing code multiple times a day.
Continuous Deployment: Facebook deploys code to production
twice a day, ensuring that new features and bug fixes are released
quickly.
Sandcastle: Facebook’s build and test infrastructure, Sandcastle,
handles the large scale of their CI/CD needs by running builds in a
highly parallelized manner.
3. Amazon
Amazon uses CI/CD practices to maintain and update its
vast range of services, from the retail platform to AWS.
Pipelines: Amazon’s CI/CD pipelines support thousands of
deployments per day, with a focus on automation and scalability.
One-Click Deployments: Amazon’s deployment tools enable
developers to deploy code to production with a single click, reducing
friction in the release process.
15. Content Beyond Syllabus
Conclusion
Implementing CI/CD best practices is crucial for modern
software development. By automating everything, keeping builds fast,
testing in production-like environments, and using the right tools, you
can build a CI/CD pipeline that accelerates development and enhances
software quality. Learning from real-world examples like Netflix,
Facebook, and Amazon can provide valuable insights into creating a
successful CI/CD pipeline in your organization.
16. Assessment Schedule

Tentative schedule for the Assessment During 2024-2025 Even Semester

S. Name of the
Start Date End Date Portion
No. Assessment

1 Unit Test 1 January 2025 January 2025 Unit 1

2 IAT 1 25th January 2025 03rd February 2024 Unit 1 & 2

3 Unit Test 2 February 2024 February 2024 Unit 3

4 IAT 2 10th March 2024 15th March 2024 Unit 3 & 4

5 Revision 1 April 2024 April 2024 Unit 5, 1 & 2

6 Revision 2 April 2024 April 2024 Unit 3 & 4

7 Model 03rd April 2024 17th April 2024 All 5 Units


17. Text Books & References

TEXTBOOKS:
1. Deepak Gaikwad, Viral Thakkar, "DevOps Tools: from Practitioner's
Point of View", Wiley, 2019.
2. Jennifer Davis, Ryn Daniels, "Effective DevOps", O'Reilly Media, 2016.

REFERENCES:
1. Gene Kim, Jez Humble, Patrick Debois, "The DevOps Handbook: How
to Create World-Class Agility, Reliability, and Security in Technology
Organizations", IT Revolution Press, 2016.
2. Jez Humble, Gene Kim, "Continuous Delivery: Reliable Software
Releases Through Build, Test, and Deployment Automation", Addison-
Wesley, 2010.
3. Yevgeniy Brikman, "Terraform: Up & Running: Writing Infrastructure
as Code", O'Reilly Media, 2019.
4. Joseph Muli, "Beginning DevOps with Docker", Packt Publishing, 2018.
18. Mini Project Suggestions
1. CI/CD Pipeline using Azure (CO3, K3)

This DevOps project is again one of the best project ideas for any
beginner where you just need to set up continuous delivery (CD) and
continuous integration (CI) pipelines using Azure DevOps. A CI/CD pipeline is a
key part of any DevOps process. Azure provides you a powerful set of tools
useful to implement a CI/CD pipeline, including Azure Container Registry,
Azure Pipelines, and Azure App Service.

While working on this project, you'll learn how to use these services to build a
complete CI/CD pipeline for a web application.

2. Jenkins Remoting Project(CO3, K3)

Another project in the list of DevOps project ideas is creating a


Jenkins Remoting project. Jenkins Remoting is a library and archive for
communication layer creation. While learning this project, you'll need
knowledge of networking fundamentals, Java, and message queues to execute
the task.

The features included in this project are TCP protocols, procedure


calls, data streaming, etc. The basic objective of this DevOps project is to
provide a set of APIs and tools to remotely control the Jenkins server
developers. This is one of the basic-level projects for any beginner who's
looking for a career in DevOps.
Thank you

Disclaimer:

This document is confidential and intended solely for the educational purpose of RMK Group of
Educational Institutions. If you have received this document through email in error, please notify the
system manager. This document contains proprietary information and is intended only to the
respective group / learning community as intended. If you are not the addressee you should not
disseminate, distribute or copy through e-mail. Please notify the sender immediately by e-mail if you
have received this document by mistake and delete this document from your system. If you are not
the intended recipient you are notified that disclosing, copying, distributing or taking any action in
reliance on the contents of this information is strictly prohibited.

You might also like