Unit 3
Unit 3
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; Branching and merging;Teams can create
separate branches for different features or bug fixes, then merge the changes back into the main codebase;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;History of Source
Code Management (SCM);Early SCM systems were simple and focused on tracking changes to source code over time;In
the late 1990s and early 2000s, the open-source movement and the rise of the internet led to a proliferation of new
SCM tools, including CVS (Concurrent Versions System), Subversion, and Git;As DevOps emerged as a software
development methodology in the mid-2000s, SCM became an integral part of the DevOps toolchain. DevOps teams
adopted Git as their SCM tool of choice, leveraging its distributed nature, branch and merge capabilities, and integration
with CI/CD pipelines;Today, Git is the most widely used SCM system in the world, and is a critical component of DevOps
practices.It also offer features like collaboration, code reviews, and integrated issue tracking;Roles;Development team;
responsible for writing and testing code;Operations team;responsible for the deployment and maintenance of the code
in production;DevOps team; responsible for bridging the gap between development and operations, ensuring that code
is delivered quickly and reliably to production; Code;Code is the backbone of DevOps and represents the software that is
being developed, tested, deployed, and maintained;Code is managed using source code control systems like Git, which
provide a way to track changes to the code over time, collaborate on the code with other team members, and automate
the build, test, and deployment process;Code is continuously integrated and tested, ensuring that any changes to the
code do not cause unintended consequences in the production environment;A source code management (SCM);system
is a software application that provides version control for source code. It tracks changes made to the code over time,
enabling teams to revert to previous versions if necessary, and helps ensure that code can be collaborated on by
multiple team members;SCM systems typically provide features such as version tracking, branching and merging, change
history, and rollback capabilities. Some popular SCM systems include Git, Subversion, Mercurial, and Microsoft Team
Foundation Server;Source code management (SCM) systems are often used to manage code migrations, which are the
process of moving code from one environment to another;Benefits ;Version control;Branching and merging; Rollback;
Collaboration.
Shared authentication;in DevOps refers to the practice of using a common identity management system to control
access to the various tools, resources, and systems used in software development and operations;This helps to simplify
the process of managing users and permissions and ensures that everyone has the necessary access to perform their
jobs;Examples of shared authentication systems include Active Directory, LDAP, and SAML-based identity providers.
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;Implementations;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.
Docker Intermission;is a tool or platform design to simplify the process of creating, deploying, and packaging and
shipping out applications along with its parts such as libraries and other dependencies. Its primary purpose is to
automate the deployment process and operating-system-level virtualization on Linux. It allows multiple containers to
run on the same hardware and provides high productivity, along with maintaining isolated applications and facilitating
seamless configuration;Benefits;High ROI and cost savings;Productivity and standardization;Maintenance and
compatibility;Rapid deployment;Faster configurations;Seamless portability;Continuous testing and deployment;
Isolation, segregation, and security;Installing Docker;To install docker in red hat based systems use; dnf install docker-io;
To enable and start docker,use ; system c+l enable docker ; system c+l start docker ; we need another tool called Docker
Compose to start multiple docker applications together.
GitLab; is an open-source Git repository management platform that provides a wide range of features for software
development teams. It is commonly used in DevOps for version control, issue tracking, code review, and continuous
integration/continuous deployment (CI/CD) pipelines;GitLab provides a centralized platform for teams to manage their
Git repositories, track changes to source code, and collaborate on code development. It offers a range of tools to
support code review and collaboration, including pull requests, code comments, and merge request approvals;In
addition, GitLab provides a CI/CD pipeline tool that allows teams to automate the process of building, testing, and
deploying code. This helps to streamline the development process and reduce the risk of introducing bugs or other
issues into the codebase;Overall, GitLab is a comprehensive Git repository management platform that provides a wide
range of tools and features for software development teams. By using GitLab, DevOps teams can improve the efficiency,
transparency, and collaboration of their software development processes.
Gerrit;is a web based code review tool which is integrated with Git and built on top of Git version control system;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);The stable release of Gerrit is 2.12.2 and
published on March 11, 2016 licensed under Apache License v2;Features;Gerrit is a free and an open source Git version
control system;The user interface of Gerrit is formed on Google Web Toolkit;It is a lightweight framework for reviewing
every commit;Gerrit acts as a repository, which allows pushing the code and creates the review for your commit;
Advantages;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;Gerrit is supported by Eclipse;Disadvantages;Reviewing, verifying and resubmitting the code
commits slows down the time to market;Gerrit can work only with Git;Gerrit is slow and it's not possible to change the
sort order in which changes are listed;You need administrator rights to add repository on Gerrit; Gerrit Works
Architecture?; The code review process
allows newcomers to see the code of
other more experienced developers.
Developers can get feedback on their
suggested changes;Experienced
developers can help to evaluate the
impact on the whole code;Shared code
ownership: by reviewing code of other
developers the whole team gets a solid
knowledge of the complete code
base;Running Gerrit with Docker;use
following Docker command to
start,Gerrit;docker run -d –p 8080:8080
–p 29418:29418 <gerrrit image _name>;
Docker run(starting the new container
to pull image that containes gerrit
application);-d(Detached mode that
runs container in background); -p 8080:8080 –p 29418:29418(port number); <gerrit image_name>(image name that
contains gerrit application);Access Gerrit;open your browser and go to “http://<docker host url>:8080”.