Unit 3 - DevOps
Unit 3 - DevOps
Source code control (also known as version control) is an essential part of DevOps practices. Here are
a few reasons why:
Collaboration: Source code control allows multiple team members to work on the same codebase
simultaneously and track each other's changes.
Traceability: Source code control systems provide a complete history of changes to the code,
enabling teams to trace bugs, understand why specific changes were made, and roll back to previous
versions if necessary.
Branching and merging: Teams can create separate branches for different features or bug fixes, then
merge the changes back into the main codebase. This helps to ensure that different parts of the code
can be developed independently, without interfering with each other.
Continuous integration and delivery: Source code control systems are integral to continuous
integration and delivery (CI/CD) pipelines, where changes to the code are automatically built, tested,
and deployed to production.
In summary, source code control is a critical component of DevOps practices, as it enables teams to
collaborate, manage changes to code, and automate the delivery of software.
The evolution of Source Code Management (SCM) parallels the growth of software development:
1. Early Days
o Made collaboration, version control, and automation of build, test, and deployment
easier.
4. Today
Hosted Git servers are online platforms that provide Git repository hosting services for software
development teams. They are widely used in DevOps to centralize version control of source code,
track changes, and collaborate on code development. Some popular hosted Git servers include
GitHub, GitLab, and Bitbucket. These platforms offer features such as pull requests, code reviews,
issue tracking, and continuous integration/continuous deployment (CI/CD) pipelines.
There are several different Git server implementations that organizations can use to host their Git
repositories. Some of the most popular include:
GitHub: One of the largest Git repository hosting services, GitHub is widely used by developers for
version control, collaboration, and code sharing.
GitLab: An open-source Git repository management platform that provides version control, issue
tracking, code review, and more.
Bitbucket: A web-based Git repository hosting service that provides version control, issue tracking,
and project management tools.
Gitea: An open-source Git server that is designed to be lightweight, fast, and easy to use.
Gogs: Another open-source Git server, Gogs is designed for small teams and organizations and
provides a simple, user-friendly interface.
GitBucket: A Git server written in Scala that provides a wide range of features, including issue
tracking, pull requests, and code reviews.
Organizations can choose the Git server implementation that best fits their needs, taking into
account factors such as cost, scalability, and security requirements.
Docker intermission
Docker is an open-source project with a friendly-whale logo that facilitates the deployment of
applications in software containers.
It is a set of PaaS products that deliver containers (software packages) using OS-level virtualization.
Docker is a tool that makes it easy to create, package, and deploy applications with all their parts, like
libraries and dependencies.
It automates application deployment and uses virtualization to run multiple containers on the same
hardware.
● Rapid deployment
● Faster configurations
● Seamless portability
A Virtual Machine (VM) provides a dedicated environment for applications. Both Docker and VMs
have their advantages, but for running applications in different environments, either can be used.
Here's a quick comparison to help decide which fits better.
OS Support: VM requires a lot of memory when installed in an OS, whereas Docker containers
occupy less space.
Performance: Running several VMs can affect the performance, whereas, Docker containers are
stored in a single Docker engine; thus, they provide better performance.
Scaling: VMs are difficult to scale up, whereas Docker is easy to scale up.
Gerrit
Gerrit is a web based code review tool which is integrated with Git and built on top of Git version
control system (helps developers to work together and maintain the history of their work). It allows
to merge changes to Git repository when you are done with the code reviews.
Gerrit was developed by Shawn Pearce at Google which is written in Java, Servlet, GWT(Google Web
Toolkit).
● You can easily find the error in the source code using Gerrit.
● You can work with Gerrit, if you have regular Git client; no need to install any Gerrit client.
Features of Gerrit
● Gerrit acts as a repository, which allows pushing the code and creates the review for your
commit.
Advantages of Gerrit
● Gerrit provides access control for Git repositories and web frontend for code review.
● You can push the code without using additional command line tools.
● Gerrit can allow or decline the permission on the repository level and down to the branch
level.
Disadvantages of Gerrit
● Reviewing, verifying and resubmitting the code commits slows down the time to market.
● Gerrit is slow and it's not possible to change the sort order in which changes are listed.
It is used to store the merged code base and the changes under review that have not being merged
yet. Gerrit has the limitation of a single repository per project.