0% found this document useful (0 votes)
3 views

Unit 03 Devops

This document provides an overview of source code control (also known as version control), emphasizing its importance in software development for tracking changes, facilitating collaboration, and ensuring code integrity. It discusses various source control management tools, the evolution of version control systems, and the roles and responsibilities associated with source code management. Additionally, it highlights the advantages of distributed version control systems, particularly Git, and their impact on modern development practices.

Uploaded by

indhu mathi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Unit 03 Devops

This document provides an overview of source code control (also known as version control), emphasizing its importance in software development for tracking changes, facilitating collaboration, and ensuring code integrity. It discusses various source control management tools, the evolution of version control systems, and the roles and responsibilities associated with source code management. Additionally, it highlights the advantages of distributed version control systems, particularly Git, and their impact on modern development practices.

Uploaded by

indhu mathi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 58

UNIT III

INTRODUCTION TO
PROJECT MANAGEMENT
Balike Mahesh
B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE ) 7207030340
The need for source code control
• for DevOps purposes, indeed nearly everything can be
expressed in codified form, including the following:
• The applications that we build
• The infrastructure that hosts our applications
• The documentation that documents our products
• Even the hardware that runs our applications can be
expressed in the form of software.
• Given the importance of code, it is only natural that the location
that we place code, the source code repository, is central to our
organization. Nearly everything we produce travels through the
code repository at someB.MAHESH
point in its life cycle.
(YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )
List of Source Control Management
Tools
• Source control tools include:
• Git
• Helix Core
• Subversion
• ClearCase
• Team Foundation Server
• Mercurial

B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )


• Source code control, also known as version control or revision
control, is a crucial aspect of software development and
collaboration. It refers to the management of changes made to
source code files, allowing developers to track, organize, and
control modifications to their codebase over time. The need for
source code control arises due to several reasons:
1.Versioning and History: Source code control systems enable
developers to maintain a complete history of changes made to
the codebase. Every modification, including additions,
deletions, and modifications, is tracked, along with the author,
timestamp, and a description of the changes. This versioning
capability allows developers to understand the evolution of the
code, revert to earlier versions if necessary, and track the
impact of changes on the software.
B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )
• 2.Collaboration and Teamwork: In software development projects
involving multiple developers or teams, source code control is
indispensable. It provides a centralized repository where developers can
collaboratively work on the codebase, merge their changes, and handle
conflicts effectively. With concurrent access to the source code, developers
can work independently on different features or bug fixes, making it easier
to manage complex projects.
• 3.Code Integrity and Safety: Source code control systems
ensure the integrity and safety of the codebase. By using a
centralized repository, developers can prevent accidental loss or
corruption of code. If mistakes are made, it is possible to revert to
a previous working version. Additionally, source code control
allows for branching and merging, enabling developers to
experiment with new features or fixes without affecting the main
codebase until they are ready.
B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )
4.Bug Tracking and Issue Management: Source code control can
integrate with issue tracking systems, allowing developers to link code
changes to specific bugs or issues. This integration streamlines the
development process by providing traceability between code changes
and the problems they address. It also facilitates collaboration between
developers and testers, making it easier to identify and fix software
issues.
5.Facilitating Continuous Integration and Deployment: Source code
control systems play a crucial role in enabling continuous integration and
deployment (CI/CD) practices. By automating the build, test, and
deployment processes, developers can ensure that changes in the
codebase are thoroughly tested and deployed to production efficiently.
CI/CD pipelines can be triggered automatically based on code commits,
ensuring that software is delivered rapidly and reliably.
B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )
6.Code Reusability and Collaboration: Source code control allows
developers to share code and collaborate on reusable components. By
organizing code into libraries, modules, or packages, it becomes easier
to reuse existing functionality across projects, saving development time
and effort. With proper versioning, developers can track and manage
different versions of shared components.
7.Facilitating Code Reviews: Source code control systems provide a
platform for conducting code reviews. Developers can submit their
changes for review, and reviewers can provide feedback, suggest
improvements, or identify potential issues. Code reviews enhance code
quality, promote knowledge sharing, and help maintain coding standards
within the development team.
Overall, source code control is essential for efficient and
collaborative software development. It ensures the integrity and safety of
the codebase, facilitates teamwork and collaboration, enables
versioning and history tracking, supports CI/CD practices, and promotes
code reusability and codeB.MAHESH
quality through processes like code reviews.
(YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )
The history of source code management dates back several decades,
evolving alongside the development of software engineering practices.
Here is a brief overview of the major milestones in the history of source
code management:
1.Early Version Control Systems (VCS): In the 1970s, developers
began using rudimentary version control systems to manage source
code. These systems relied on simple methods like copying files to
different directories with version numbers or using shell scripts to track
changes.
2.SCCS and RCS: The Source Code Control System (SCCS) was
developed in the late 1970s by Marc Rochkind at Bell Labs. SCCS
introduced the concept of storing changes as differences or patches,
enabling efficient storage of multiple versions of files. It provided basic
version control capabilities but lacked network support. Later, the
Revision Control System (RCS) was developed as an open-source
alternative to SCCS, adding support for multiple users and network
B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )
3.Centralized Version Control Systems (CVCS): In the 1980s and 1990s,
centralized version control systems became popular. These systems utilized
a central repository to store the entire history of the codebase. Developers
would check out files from the repository, make modifications, and check
them back in. Notable examples include Concurrent Versions System (CVS)
and later, Subversion (SVN). CVCS offered improved collaboration and
versioning capabilities compared to earlier systems.

4.Distributed Version Control Systems (DVCS): The rise of distributed


version control systems revolutionized source code management. In 2005,
Linus Torvalds created Git, which quickly gained popularity and became the
de facto standard for many developers. Git introduced a distributed model
where every local copy of the repository contained the full history. This
distributed nature enabled developers to work offline, branch and merge
easily, and collaborate effectively. Other notable DVCS systems include
B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )
Mercurial and Bazaar.
5.Hosted Version Control Platforms: With the growth of cloud computing, hosted
version control platforms emerged. These platforms, such as GitHub, GitLab, and
Bitbucket, provided web-based interfaces for managing Git repositories. They
offered additional collaboration features like issue tracking, pull requests, code
reviews, and integrations with other development tools. Hosted platforms facilitated
social coding, open-source collaboration, and enabled seamless teamwork across
distributed teams.
6.Advanced Version Control Workflows: Over time, developers and teams
adopted more advanced version control workflows to accommodate complex
development scenarios. Examples include feature branching workflows, Gitflow, and
trunk-based development. These workflows introduced practices like branch
management, release management, and continuous integration and deployment,
enabling streamlined and efficient software development processes.
The history of source code management has seen a progression from manual and
simplistic methods to sophisticated distributed version control systems and
collaborative platforms. These advancements have significantly improved the
productivity, collaboration, andB.MAHESH
quality of CHANNEL
(YOUTUBE software development
:: SV TECH KNOWLEDGE ) projects.
B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )
• source code control involves the following key components:
Repository: A central repository serves as the primary storage for the
source code files and their associated version history. It can be hosted
locally or remotely and can be accessed by multiple developers or
teams.
Versioning: Source code control systems keep track of changes made
to code files over time. Each change is recorded as a version or
revision, capturing the modifications, author, timestamp, and a
description of the changes. This versioning enables developers to
understand the evolution of the codebase and easily switch between
different versions when necessary.
Branching and Merging: Source code control allows developers to
create branches, which are separate lines of development that diverge
from the main codebase. Branches enable developers to work on
different features, bug fixes, or(YOUTUBE
B.MAHESH experiments independently.
CHANNEL :: SV TECH KNOWLEDGE ) Once the
changes are complete, they can be merged back into the main
Concurrency and Conflict Resolution: When multiple developers are
working on the same codebase concurrently, conflicts may arise when
attempting to merge changes. Source code control systems provide
mechanisms to identify and resolve conflicts by highlighting conflicting
changes and allowing developers to review and reconcile them
manually.
Access Control: Source code control systems offer access control
mechanisms to regulate who can view, modify, and contribute to the
codebase. Access permissions can be defined at the repository,
branch, or file level, ensuring that only authorized individuals have the
appropriate privileges.

B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )


Collaboration and Communication: Source code control systems
often provide tools and features to facilitate collaboration and
communication among team members. This includes features like code
reviews, issue tracking integration, commenting on specific code
sections, and notifications to keep developers informed about code
changes.
• Popular source code control systems include Git, Mercurial, and
Subversion, among others. These systems provide a command-line
interface as well as graphical user interfaces and integrate with
various development tools and platforms.
• In summary, source code control is a systematic approach to
managing and tracking changes to source code files. It offers
versioning, branching, merging, conflict resolution, access control, and
collaboration features, enhancing productivity, code integrity, and
teamwork in software development projects.
B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )
Roles and code [roles and responsibilities in scm ]
• From a DevOps point of view, it is important to leverage the natural meeting point
that a source code management tool is. Many different roles have a use for source
code management in its wider meaning. It is easier to do so for technically-minded
roles but harder for other roles, such as project management.
• Developers live and breathe source code management. It's their bread and butter.
• Operations personnel also favor managing the descriptions of infrastructure in the
form of code, scripts, and other artifacts, as we will see in the coming chapters.
• Such infrastructural descriptors include network topology, versions of software that
should be installed on particular servers, and so on.
• Quality assurance personnel can store their automated tests in codified form in the
source code repository. This is true for software testing frameworks such as
Selenium and Junit, among others.
• There is a problem with the documentation of the manual steps needed to perform
various tasks, though. This is more of a psychological or cultural problem than
a technical one.
B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )
• While many organizations employ a wiki solution such as the wiki
engine powering Wikipedia, there is still a lot of documentation
floating around in the Word format on shared drives and in e-mails.

This makes documentation hard to find and use for some roles and
easy for others. From a DevOps viewpoint, this is regrettable, and an
effort should be made so that all roles can have good and useful
access to the documentation in the organization.
• It is possible to store all documentation in the wiki format in the
central source code repository, depending on the wiki engine used.

B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )


• Insource code management (SCM), various roles and responsibilities are
involved in managing and controlling the source code. Here are some
common roles and their associated tasks in SCM, along with the types of
code typically handled by each role:
1.SCM Administrator: The SCM administrator is responsible for managing the
overall source code management system. They configure and maintain the
SCM tools, set up user access controls, and ensure the availability and
integrity of the source code repository.
2.Repository Manager: The repository manager is in charge of managing the
source code repository. They create and organize code repositories,
establish branching and merging strategies, and handle backups and
recovery processes. They may also define code review workflows and
manage code quality.
3.Developer: Developers are responsible for writing and modifying the source
code. They use version control tools to check out code, make changes, and
commit their changes back to the repository. Developers collaborate with
their team members, resolve merge conflicts, and ensure code quality
B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )
through best practices such as code reviews and testing.
4.Release Manager: The release manager coordinates the process of releasing
software versions. They create release branches, tag specific versions of the
code, and manage the release pipeline. Release managers ensure that the correct
code is deployed to various environments and work closely with developers and
other stakeholders to plan and execute releases.
5.Build Engineer: The build engineer is responsible for the automated build and
compilation processes. They set up build configurations, define build scripts, and
ensure that the code can be built successfully from the repository. Build engineers
also handle dependency management and artifact generation.
6.Quality Assurance (QA) Engineer: QA engineers focus on testing the code for
quality and ensuring that it meets the required standards. They may develop and
execute test scripts, perform regression testing, and collaborate with developers to
resolve any code-related issues.
• In terms of code, SCM manages various types of code artifacts, including source
code files, configuration files, build scripts, documentation files, and binary
artifacts produced during the build and release processes.
B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )
Which source code managementsystem?
• There are many source code management (SCM) systems out there, and since SCM
is such an important part of development, the development of these systems will
continue to happen.
• Currently, there is a dominant system, however, and that system is Git.
• Git has an interesting story: it was initiated by Linus Torvalds to move Linux
kernel development from BitKeeper, which was a proprietary system used at the
time. The license of BitKeeper changed, so it wasn't practical to use it for the kernel
anymore.
• Git therefore supports the fairly complicated workflow of Linux kernel development
• and is, at the base technical level, good enough for most organizations.
• The primary benefit of Git versus older systems is that it is a distributed version
control system (DVCS). There are many other distributed version control systems,
but Git is the most pervasive one.

B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )


B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )
Distributed version control systems have several advantages,
including, but not limited to, the following:
• It is possible to use a DVCS efficiently even when not connected to a network.
You can take your work with you when traveling on a train or an
intercontinental flight.
• Since you don't need to connect to a server for every operation, a DVCS can be
faster than the alternatives in most scenarios.
• You can work privately until you feel your work is ready enough to
• be shared.
• It is possible to work with several remote logins simultaneously, which avoids a
single point of failure.

B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )


B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )
Other distributed version control systems apart from Git include the
following:

• Bazaar: This is abbreviated as bzr. Bazaar is endorsed and supported


by Canonical, which is the company behind Ubuntu. Launchpad,
which is Canonical's code hosting service, supports Bazaar.
• Mercurial: Notable open source projects such as Firefox and
OpenJDK use Mercurial. It originated around the same time as Git.
• Git can be complex, but it makes up for this by being fast and efficient. It
can be hard
• to understand, but that can be made easier by using frontends that
support different tasks.

B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )


Distributed Version Control Systems (DVCS)
advantages
1. Offline Work: DVCS allows developers to work offline and independently on their local repositories. This is particularly
beneficial in situations where there is limited or no network connectivity. Developers can commit changes, create
branches, and perform other version control operations locally without needing a connection to a central server.
2. Collaboration and Parallel Development: DVCS enables parallel development by allowing multiple developers to work
on the same project simultaneously. Each developer can have their own local repository, create branches, make
changes, and merge them back to the main repository. This fosters collaboration and reduces conflicts that often arise
in centralized systems where developers need to wait for each other to make changes.
3. Flexibilityand Branching: DVCS provides greater flexibility in branching and merging. Developers can easily create
branches for new features, bug fixes, or experiments without disrupting the main codebase. Multiple branches can
exist concurrently, and merging changes between branches is typically simpler and more efficient in DVCS.
4. Speed and Performance: DVCS is often faster and more performant compared to centralized systems, especially for
common operations like committing changes, switching branches, or viewing revision history. This is because these
operations can be performed locally on the developer's machine without relying on network communication with a
central server.
5. Redundancy and Backup: With DVCS, every developer has a full copy of the entire project's history and codebase.
This redundancy acts as a built-in backup mechanism, providing additional protection against data loss or corruption.
If a central server goes down or is compromised, developers can still retrieve the entire history from their local
repositories.
6. Flexibility
in Workflow: DVCS allows teams to adopt different workflow models, such as Gitflow, Feature Branching, or
Forking Workflow, to suit their specific development processes and requirements. This flexibility supports agile
development practices and encourages efficient collaboration within the team.
B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )
• Overall, the advantages of distributed version control systems contribute to increased developer productivity,
improved collaboration, and greater flexibility in managing codebases and development workflows.
source code managementsystem migrations
• SCM migration is not just about switching from one version control system to another.
It's an opportunity to correct old inconsistencies or challenges and implement modern
and collaborative workflows to make the developer's work easier.
• Migrating from one source code management system (SCM) to another involves
transferring the existing codebase, including the version history and associated
metadata, to the new system while ensuring data integrity and minimizing disruptions to
the development team.
• Here are a few key considerations and best practices when undertaking a source code
management system migration:
1.Thorough planning: Proper planning is essential to ensure a smooth migration process.
Start by defining clear objectives, understanding the reasons for the migration, and
establishing a timeline and budget. Identify potential risks and develop contingency plans
to address them.
2.Selecting the right target system: Evaluate and select a suitable target SCM system
that aligns with your requirements, taking into account factors such as scalability,
integrations with other tools, ease of(YOUTUBE
B.MAHESH use, CHANNEL
and support for your
:: SV TECH KNOWLEDGE ) development workflows.
3.Preparing the codebase: Before the migration, clean up and organize the
codebase to minimize any unnecessary baggage. Remove unused or
obsolete code, ensure consistent file and folder structures, and resolve any
outstanding issues or conflicts.
4.Data migration strategy: Determine the most appropriate method to
migrate the codebase and version history to the new SCM system. Options
may include exporting and importing repositories, using migration tools, or
writing custom scripts. Ensure that the migration process preserves commit
history, branches, tags, and any associated metadata.
5.Communication and training: Inform and involve the development team
throughout the migration process. Communicate the reasons for the
migration, address concerns, and provide training on the new SCM system to
ensure a smooth transition. Consider organizing workshops or documentation
to assist with onboarding and provide ongoing support.
6.Testing and validation: Perform thorough testing and validation of the
migrated codebase to ensure that all versions, branches, and tags are
correctly transferred. Test common SCM operations and integrations with
other tools or systems to ensure functionality
B.MAHESH (YOUTUBE and
CHANNEL :: SV TECH compatibility.
KNOWLEDGE )
7.Rollback plan: Despite careful planning, unexpected issues may arise
during the migration. Develop a rollback plan to revert to the original SCM
system if necessary. This plan should include steps to back up the original
codebase and define criteria for deciding when to trigger the rollback.
8.Post-migration clean-up: After the migration is complete, conduct a post-
migration review to identify any issues or gaps. Clean up any artifacts,
remnants, or redundant data left behind during the migration process.
9.Change management: Change management processes should be in
place to handle the transition and address any challenges or resistance from
the development team. Provide ongoing support and monitor the adoption
and usage of the new SCM system to address any issues or gaps.

B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )


Choosing a branching strategy
• Branching is a fundamental concept in version control systems, including Git.
It allows developers to create separate lines of development within a
codebase, enabling multiple concurrent workflows and isolating changes
from the main codebase until they are ready to be integrated.
• A branching strategy is a convention, or a set of rules, that describes when branches are
created, how they are to be named, what use branches should have, and so on.
• Branching strategies are important when working together with other people and are, to a
degree, less important when you are working on your own, but they still have a purpose.
• Most source code management systems do not prescribe a particular branching strategy
and neither does Git. The SCM simply gives you the base mechanics to perform branching.
• With Git and other distributed version control systems, it is usually pretty cheap to work
locally with feature branches. A feature, or topic, branch is a branch that is used to keep
track of ongoing development regarding a particular feature, bug, and so on. This way, all
changes in the code regarding the feature can be handled together.
B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )
There are many well-known branching strategies. Vincent Driessen formalized a branching strategy
called Git flow, which has many good features. For some, Git flow is too complex, and in those
cases, it can be scaled down. There are many such scaled-down models available. This is what Git
flow looks like:
Ti
me

1.0
0.2
0.1

Tag
Tag
Tag
master
hotfixes

branch for
Start of
release

bugfixes!
production:
Severe bug

hotfix 0.2

1.0

Only
fixed for

Bugfixes from

into develop
merged back
continuously
branches

rel. branch
release

may be
Incorporate

develop
bugfix in
develop

''next release'' means


the release after 1.0
From this point on,
next release
feature for
branches
feature

Major
for future
Feature

release

B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )


NOTE :: DRAW THIS FIGURE IN VARTICAL MANNER IN EXAM
• Git flow looks complex, so let's have a brief look at what the branches are for:
• The master branch only contains finished work. All commits are tagged,
since they represent releases. All releases happen from master.
• The develop branch is where work on the next release happens. When
work is finished here, develop is merged to master.
• We use separate feature branches for all new features. Feature branches
are merged to develop.
• When a devastating bug is revealed in production, a hotfix branch is made
where a bug fix is created. The hotfix branch is then merged to master, and a
new release for production is made.
• Git flow is a centralized pattern, and as such, it's reminiscent of the
workflows used with Subversion, CVS, and so on. The main difference is that
using Git has some technical and efficiency-related advantages.
• Another strategy, called the forking pattern, where every developer has a
central repository, is rarely used in practice within organizations, except
when, for instance, external parties such as subcontractors are being
employed.

B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )
Branching problem areas
• While branching is a powerful feature in version control systems, it can introduce certain challenges
and problem areas if not managed effectively. Here are some common issues that can arise when
working with branches:
1. Branch Overload: Having too many branches can lead to confusion and complexity. If branches are
not properly managed, it becomes difficult to track the purpose and status of each branch. It's
important to establish clear guidelines and conventions for branch naming, usage, and lifecycle
management.
2. Long-Lived Branches: Branches that exist for an extended period can become divergent from the
main codebase, making it harder to merge changes back. Frequent merges from the main branch
into long-lived branches and keeping them up to date can help mitigate this issue.
3. Merge Conflicts: When multiple developers make changes to the same files or code sections,
merge conflicts can occur when trying to merge branches together. Resolving conflicts can be time-
consuming and requires careful attention to ensure the merged code maintains its integrity. Regular
communication and coordination among team members can help reduce the occurrence of conflicts.
4. Delayed Integration: If branches are kept isolated for too long without regular integration with the
main branch, it becomes difficult to detect and resolve integration issues. Delayed integration can
lead to more significant conflicts and challenges when merging changes. Encouraging frequent
integration, preferably through continuous integration
B.MAHESH (YOUTUBE CHANNEL ::practices, can )help avoid this problem.
SV TECH KNOWLEDGE
5.Lack of Visibility and Communication: When working with multiple
branches, it's important to maintain good communication and visibility
among team members. Lack of communication about branch status,
changes, or conflicts can result in duplication of work, wasted effort, or
misunderstandings. Tools like issue trackers, pull requests, and regular
team meetings can facilitate better communication and collaboration.
6.Inconsistent Branching Strategies: Inconsistent usage of branching
strategies within a team or across projects can lead to confusion and
difficulties in managing the codebase. It's important to establish and
document a clear branching strategy that aligns with the team's
development process and goals.
7.Unmerged or Abandoned Branches: Over time, branches may
become unmerged or abandoned, resulting in unused or obsolete code.
Cleaning up such branches regularly can help maintain a clean and
manageable codebase. B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )
Shared authentication
• In the context of source code management (SCM), shared authentication refers to the
practice of using a common authentication mechanism or identity provider to authenticate
users accessing the SCM system. It allows users to use their existing credentials to
access the SCM system without requiring separate authentication.
• Here's how shared authentication can be implemented in SCM:
1.Integration with Identity Providers: The SCM system can be integrated with an identity
provider (IdP) that serves as the central authority for user authentication. The IdP could be
an internal authentication service or a third-party provider that supports industry-standard
protocols like SAML, OAuth, or OpenID Connect.
2.Single Sign-On (SSO): By implementing shared authentication, users can log in to the
IdP once and then access the SCM system without being prompted to enter their
credentials again. This provides a seamless user experience and eliminates the need for
separate SCM-specific credentials.

B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )


3.Federated Authentication: Shared authentication in SCM often involves
federated authentication, where the SCM system relies on the IdP to
authenticate users. The SCM system trusts the authentication assertions or
tokens issued by the IdP and uses them to grant access to the appropriate
repositories, branches, or actions.
4.User Provisioning and Permissions: The IdP can also handle user
provisioning, ensuring that user accounts and permissions are synchronized
between the IdP and the SCM system. When a user is added or removed
from the IdP, the SCM system can automatically reflect those changes,
granting or revoking access accordingly.
5.Secure Transmission: It is important to ensure that authentication
requests and responses between the SCM system and the IdP are
transmitted securely. This typically involves using secure communication
protocols like HTTPS to protect sensitive information during the
authentication process. B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )
• By implementing shared authentication in SCM, organizations can achieve several benefits:
• Centralized User Management: Shared authentication allows for centralized user
management, making it easier to add, update, or remove user accounts across the
organization's systems.
• Consistent Access Control: Users' access to repositories, branches, or specific actions in
the SCM system can be managed centrally through the IdP, ensuring consistent access
control policies and reducing administrative overhead.
• Improved Security: Shared authentication can enhance security by leveraging the IdP's
robust authentication mechanisms, including multi-factor authentication, password policies,
and account recovery processes.
• Streamlined Onboarding: New team members can quickly gain access to the SCM system
by leveraging their existing credentials from the IdP, simplifying the onboarding process.
• To implement shared authentication in SCM, organizations should choose an SCM system
that supports integration with popular IdPs or SSO solutions. Configuration settings and
authentication options within the SCM system need to be properly set up to establish the
trust relationship and enable secure communication with the IdP.
• Overall, shared authentication inB.MAHESH
SCM(YOUTUBE
enhances user
CHANNEL :: SV TECHexperience,
KNOWLEDGE ) simplifies user
management, and strengthens security by leveraging a centralized authentication
UNIT 3 PART-2
HOSTED GIT SERVERS
Balike Mahesh
7207030340

B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )


Hosted Git servers
• Many organizations can't use services hosted within another organization's walls
at all.
• These might be government organizations or organizations dealing with money,
such as bank, insurance, and gaming organizations.
• The causes might be legal or, simply nervousness about letting critical code leave the
organization's doors, so to speak.
• If you have no such qualms, it is quite reasonable to use a hosted service, such as
GitHub or GitLab, that offers private accounts.
• Using GitHub or GitLab is, at any rate, a convenient way to get to learn to use Git
and explore its possibilities.
• Both vendors are easy to evaluate, given that they offer free accounts where you can
get to know the services and what they offer. See if you really need all the services or
if you can make do with something simpler.
B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )
• Many organizations, especially government entities and those
involved in finance, such as banks, insurance companies, and gaming
organizations, face restrictions in utilizing externally hosted services.
These restrictions can stem from legal considerations or concerns
about the security and confidentiality of critical code leaving the
organization's premises.
• However, if such concerns are not applicable to your organization,
opting for a hosted service like GitHub or GitLab can provide a
convenient solution for learning and utilizing Git, as well as exploring
its capabilities. Both platforms offer private accounts, allowing you to
maintain control over your code and repositories.
• Fortunately,GitHub and GitLab provide free account options that
enable you to evaluate their services and features. This allows you to
determine whether you truly require all the available services or if a
simpler solution would suffice for CHANNEL
B.MAHESH (YOUTUBE your:: SVneeds.
TECH KNOWLEDGE )
• There are several popular hosted Git server platforms available that offer remote hosting of Git
repositories. These platforms provide a convenient way to store and collaborate on your code, manage
versions, and track changes. Some of the most widely used hosted Git servers include:
1. GitHub: GitHub is one of the most popular Git hosting platforms. It offers a wide range of features,
including repository hosting, issue tracking, pull requests, and code review tools. GitHub also provides
integration with various development tools and services, making it a preferred choice for many open-
source projects and individual developers.
2. GitLab: GitLab is another widely used Git hosting platform that offers both cloud-based and self-hosted
options. GitLab provides a complete DevOps platform with features like CI/CD pipelines, container
registry, project management tools, and a built-in issue tracker. It is known for its robust continuous
integration and deployment capabilities.
3. Bitbucket: Bitbucket is a Git and Mercurial-based hosting platform that offers both cloud-based and self-
hosted options. It provides unlimited private repositories, code collaboration features, and integrates with
various project management and CI/CD tools. Bitbucket is often preferred by teams using other Atlassian
products, such as Jira and Confluence.
4. Azure DevOps: Azure DevOps (previously known as Visual Studio Team Services) is a comprehensive
development platform offered by Microsoft. It provides version control using Git, along with a range of
other development and project management tools. Azure DevOps offers both cloud-hosted and self-
hosted options and integrates well with other Microsoft tools and services.
• These hosted Git server platforms have different pricing plans and features, so it's important to evaluate
your specific needs and choose the one that best suits your requirements. Additionally, some cloud
providers like AWS and Google Cloud also offer their Git hosting solutions, such as AWS CodeCommit
and Google Cloud Source Repositories, respectively.

B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )


Some of the features offered by both GitLab
and GitHub over plain Git are as follows:

• Web interfaces
• A documentation facility with an inbuilt wiki
• Issue trackers
• Commit visualization
• Branch visualization
• The pull request workflow

B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )


• Both GitLab and GitHub offer a range of features that make them popular choices for hosting Git repositories and
collaborating on code. Here are some key features offered by both platforms:
1. Repository Hosting: Both GitLab and GitHub allow you to create and host Git repositories for your projects. You can
clone, push, and pull code using Git commands and access your repositories securely.
2. Issue Tracking: Both platforms provide built-in issue tracking systems that allow you to create, manage, and track
issues or bugs related to your codebase. You can assign issues, set priorities, add labels, and create custom
workflows to streamline your development process.
3. Pull Requests and Code Review: GitLab and GitHub support pull requests, which enable developers to propose code
changes, review them, and merge them into the main branch. You can leave comments, discuss changes, and ensure
code quality before merging.
4. Collaboration and Team Management: Both platforms offer collaboration features like team management, user
permissions, and access controls. You can invite team members, assign roles, and define user permissions to control
access to repositories and project resources.
5. Continuous Integration and Deployment (CI/CD): GitLab and GitHub provide CI/CD capabilities to automate building,
testing, and deploying your applications. You can define pipelines and configure triggers to execute various actions,
such as running tests, building artifacts, and deploying to production environments.
6. Project Management and Boards: Both platforms include project management tools, such as kanban boards, for
visualizing and managing tasks and workflows. You can create and organize project boards, track progress, and
manage your development process.
7. Integrations and Marketplace: GitLab and GitHub offer integrations with various third-party tools and services. They
have marketplaces with a wide range of extensions, plugins, and integrations to enhance your development workflow
and integrate with popular services like Jira, Slack, and Docker.
• It's worth noting that while GitLab offers many of these features as part of its core offering, GitHub provides some
advanced features, such as code scanning, security vulnerability alerts, and code spaces, through its paid plans or
separate add-ons.
B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )
Different Git server implementations

• The distributed nature of Git makes it possible to try out different Git
implementations for various purposes. The client-side setup will be similar
regardless of how the server is set up.
• You can also have several solutions running in parallel. The client side is not unduly
• complicated by this, since Git is designed to handle several remotes if need be

B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )


Different Git server implementations
• There are several Git server implementations available, each with its own unique features and capabilities. Here are
a few notable Git server implementations:
1. GitLab: GitLab is not only a hosted Git platform but also an open-source Git server implementation. It provides a
complete DevOps platform with features like repository hosting, issue tracking, continuous integration/continuous
deployment (CI/CD), project management, and more. GitLab can be self-hosted on your own infrastructure, giving
you full control over your codebase and data.
2. Gitea: Gitea is a lightweight, self-hosted Git server implementation written in Go. It offers a simple and intuitive user
interface, along with features like repository management, issue tracking, pull requests, and user management.
Gitea is designed to be easy to set up and suitable for small to medium-sized projects or personal use.
3. Bitbucket Server: Bitbucket Server, formerly known as Stash, is the self-hosted version of Atlassian's Bitbucket
platform. It provides Git and Mercurial repository hosting, along with features like pull requests, code review, issue
tracking, and project management. Bitbucket Server is often favored by organizations that already use other
Atlassian tools like Jira and Confluence.
4. RhodeCode: RhodeCode is an enterprise-grade, self-hosted Git server implementation. It offers features such as
code collaboration, access controls, code review, issue tracking, and CI/CD integration. RhodeCode aims to provide
a secure and scalable solution for organizations that require fine-grained permissions and advanced repository
management.
5. SCM Manager: SCM Manager is an open-source Git server implementation that supports other version control
systems like Subversion and Mercurial as well. It provides a web-based interface for repository management, user
access control, and basic project management features. SCM Manager is known for its simplicity and ease of use.
• These are just a few examples of Git server implementations available. Depending on your specific requirements
and preferences, you can choose the one that best
B.MAHESH suits
(YOUTUBE your ::needs
CHANNEL SV TECH in terms of) features, scalability, security, and
KNOWLEDGE
integration capabilities.
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
merging changes to Git repository when you are done with the code reviews.
• 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). The stable release of Gerrit is 2.12.2 and published on March 11, 2016 licensed
under Apache License v2.
• Why Use Gerrit?
• Following are certain reasons, why you should use Gerrit.
• 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.
• Gerrit can be used as an intermediate between developers and git repositories.
B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )
• Features of Gerrit
• 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 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.
• Gerrit is supported by Eclipse.
• Disadvantages of Gerrit
• 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.

B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )


GERRIT
• Gerrit is a web-based code review and collaboration tool primarily used in software development projects. It is based on Git, a
distributed version control system, and provides a platform for developers to review, comment on, and merge code changes before
they are integrated into the main codebase.

• Gerrit allows developers to submit code changes in the form of patches or commits for review. Other team members can then review
the changes, add comments, and suggest improvements. The code review process in Gerrit facilitates collaboration and ensures that
code changes meet the project's standards and guidelines.
• Some key features of Gerrit include:

1. Code review workflow: Gerrit provides a structured workflow for code reviews, allowing reviewers to provide feedback, discuss
changes, and make decisions on whether the code changes should be accepted or rejected.
2. Access controls: Gerrit offers fine-grained access controls, allowing project owners to define who can submit changes, review code,
and merge code into the main repository. This helps maintain security and ensures that only authorized individuals can make
changes to the codebase.

3. Integration with Git: Gerrit integrates seamlessly with Git repositories, allowing developers to push their changes for review directly
from their local Git client. It provides a web interface for reviewing and managing code changes.

4. Commenting and discussion: Reviewers can add comments directly on specific lines of code, suggesting improvements or pointing
out issues. Discussions can take place within the context of the code changes, enabling effective collaboration and communication.

5. Continuous Integration (CI) integration: Gerrit can be integrated with CI systems, such as Jenkins, to automatically trigger tests and
build processes when code changes are submitted for review. This helps ensure that code changes are thoroughly tested before they
are merged.
B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )
• Overall, Gerrit improves the code review process and facilitates better collaboration among developers working on the same project.
It helps maintain code quality, reduces the risk of introducing bugs, and ensures that the codebase is kept in a stable and
• To run a Gerrit instance with Docker, follow these steps:
1. Initialize and start Gerrit:
• docker run -d -p 8080:8080 -p 29418:29418
openfrontier/gerrit
1. Open your browser to http://<docker host url>:8080
• Now, we can try out the code review feature we would like to have.

• Installing the git-review package
• Install git-review on your local installation:
• sudo dnf install git-review
• This will install a helper application for Git to communicate with
Gerrit. It adds a new command, git-review, that is used instead of
git push to push changes to the Gerrit Git server.
B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )
The pull request model
• There is another solution to the problem of creating workflows around code
reviews:
• the pull request model, which has been made popular by GitHub.
• In this model, pushing to repositories can be disallowed except for the
repository owners. Other developers are allowed to fork the repository,
though, and make changes in their fork. When they are done making
changes, they can submit a pull request. The repository owners can then
review the request and opt to pull the changes into the master repository.
• This model has the advantage of being easy to understand, and many
developers have experience in it from the many open source projects on
GitHub.
• Setting up a system capable of handling a pull request model locally will
require something like GitHub or(YOUTUBE
B.MAHESH GitLab, which
CHANNEL we will) look at next.
:: SV TECH KNOWLEDGE
Here's an overview of the pull request
model:
• Forking: In the pull request model, the first step is for each developer to create
their own personal copy (fork) of the main repository. This allows developers to
work on their changes independently without directly affecting the main
codebase.
• Creating a Branch: Developers create a new branch in their forked repository to
work on a specific feature, bug fix, or improvement. This branch is separate from
the main branch (often called the "master" or "main" branch).
• Committing Changes: Developers make code changes and commit them to their
branch in their forked repository. These commits represent specific changes
related to the feature or fix being worked on.
• Pushing Changes and Opening a Pull Request: Once the desired changes are
committed to the branch in the forked repository, developers push the branch to
a remote repository (typically hosted on a platform like GitHub or Bitbucket).
They then open a pull request, which is a request to merge their branch into the
main repository.
• Code Review: The pull request triggers
B.MAHESH a code
(YOUTUBE CHANNEL review
:: SV TECH process.
KNOWLEDGE ) Other team
members or designated reviewers can review the code changes, leave
B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )
• Iteration and Discussion: The developer who opened the pull request can address
the feedback received during the code review process by making additional
commits to the branch in their forked repository. This allows for an iterative
process of making improvements based on the feedback received.
• Continuous Integration and Testing: Continuous Integration (CI) systems, such as
Jenkins or Travis CI, can be integrated with the pull request model. These systems
automatically build, test, and validate the changes in the pull request to ensure
that they meet the project's quality standards.
• Merge and Deployment: Once the code changes in the pull request have been
reviewed and approved, a project maintainer or an authorized individual can
merge the changes into the main repository. The merged changes can then be
deployed to the target environment through the established DevOps pipeline.
• The pull request model promotes collaboration, code review, and iteration before
merging code changes into the main repository. It helps maintain code quality,
allows for feedback and discussion among team members, and provides an
organized workflow for managing code contributions from multiple developers.
B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )
GITLAB
• Gitlab is a service that provides remote access to Git repositories. In addition to
hosting your code, the services provide additional features designed to help
manage the software development lifecycle. These additional features include
managing the sharing of code between different people, bug tracking, wiki space
and other tools for 'social coding’.

mkdir gitlab cd gitlab

wget https://raw.githubusercontent.com/sameersbn/docker-

gitlab/master/ docker-compose.yml

docker-compose up

The docker-compose command will read the .yml file and start all the required services

in a default demonstration configuration.


B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )
• If you read the startup log in the console window, you will notice that three
separate application containers have been started: gitlab postgresql1,
gitlab redis1, and gitlab gitlab1.
• The GitLab container includes the Ruby base web application and Git backend
functionality. Redis is distributed key-value store, and PostgreSQL is a relational
database.
• If you are used to setting up complicated server functionality, you will appreciate
that we have saved a great deal of time with docker-compose.
• The docker-compose.yml file sets up data volumes at /srv/docker/gitlab.
• To log in to the web user interface, use the administrator password given with the
installation instructions for the GitLab Docker image. They have been replicated
here, but beware that they might change as the Docker image author sees fit:
• Username: root
• Password: 5iveL!fe
• Here is a screenshot of the GitLab web user interface login screen:
B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )
B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )
• Try importing a project to your GitLab server from, for instance, GitHub or a
local private project.
• Have a look at how GitLab visualizes the commit history and branches.
• While investigating GitLab, you will perhaps come to agree that it offers a
great deal of interesting functionality.
• When evaluating features, it's important to keep in mind whether it's likely
that they will be used after all. What core problem would GitLab, or similar
software, solve for you?
• It turns out that the primary value added by GitLab, as exemplified by the
following two features, is the elimination of bottlenecks in DevOps
workflows:
• The management of user ssh keys
• The creation of new repositories
• These features are usually deemed to be the most useful.
• Visualization features are also useful, but the client-side visualization
available with Git clients is more useful to developers.
B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )
• Features
• GitLab hosts your (private) software projects for free.
• GitLab is a platform for managing Git repositories.
• GitLab offers free public and private repositories, issue-tracking and
wikis.
• GitLabis a user friendly web interface layer on top of Git, which
increases the speed of working with Git.
• GitLab provides its own Continuous Integration (CI) system for
managing the projects and provides user interface along with other
features of GitLab.

B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )


• Advantages
provides GitLab Community Edition version for users to locate,
• GitLab
on which servers their code is present.
• GitLab provides unlimited number of private and public repositories
for free.
• The Snippet section can share small amount of code from a project,
instead of sharing whole project.
• Disadvantages
• While pushing and pulling repositories, it is not as fast as GitHub.
• GitLab interface will take time while switching from one to another
page.

B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )


B.MAHESH (YOUTUBE CHANNEL :: SV TECH KNOWLEDGE )

You might also like