Unit 03 Devops
Unit 03 Devops
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
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
Major
for future
Feature
release
• Web interfaces
• A documentation facility with an inbuilt wiki
• Issue trackers
• Commit visualization
• Branch visualization
• The pull request workflow
• 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
• 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’.
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