0% found this document useful (0 votes)
16 views13 pages

Git and GitLab CI/CD Project Report

Devops project

Uploaded by

Arshad
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)
16 views13 pages

Git and GitLab CI/CD Project Report

Devops project

Uploaded by

Arshad
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

Version Control with Git and GitLab CI/CD

A Project Report

Submitted in partial fulfillment for the award of the degree


Of

Bachelor of Technology
In

Computer Science and Engineering


By
BANGARU SRIMANNARAYANA (22261A0507)

HARSHITH POKALA (22261A0522)

Under the guidance of

Dr [Link]
ASSISTANT PROFESSOR

Department of Computer Science & Engineering

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


MAHATMA GANDHI INSTITUTE OF TECHNOLOGY

Kokapet(Village),Gandipet,Hyderabad,Telangana–500075.

[Link]

1
We BANGARU SRIMANNARAYANA and HARSHITH POKALA , bearing the
roll numbers, 22261A0507 and 22261A0522, hereby declare that the project entitled
Version Control with Git and GitLab CI/CD under the guidance Department of
Computer Science and Engineering , MGIT, Hyderabad ,is submitted in the partial
fulfilment of the requirement for qualifying the project work course during the
academic year 2024-2025.

Project Coordinator Head of the Department


Dr [Link] Dr.C.R.K Reddy
Dept. of CSE Dept .of CSE

2
ACKNOWLEDGEMENT
We extend our sincere and heartfelt thanks to our esteemed faculty, Dr K. Rajitha,
Assistant Professor and for her exemplary guidance, monitoring and constant
encouragement throughout the course at crucial junctures and for showing us the right
way.
We are grateful to respected coordinator Dr K. Rajitha, Assistant Professor for
permitting us to utilize all the necessary facilities of the Institute.
We would like to extend thanks to our respected Head of the department, Dr C.R.K
Reddy for allowing us to use the facilities available. We would like to thank other
faculty members also.
Last but not the least, We would like to thank our friends and family for the support
and encouragement they have given us during the course of our work.

BANGARU SRIMANNARAYANA (22261A0507)


HARSHITH POKALA (22261A0522)

3
ABSTRACT
This project explores the integration of Git, a widely used version control system, with GitLab
CI/CD, a powerful tool for automating software development workflows. The primary objective is to
demonstrate how version control and automation can streamline the development process, enhance
collaboration, and ensure reliable software delivery.

The methodology involves setting up a GitLab repository, writing sample code, defining a CI/CD
pipeline using the .[Link] file, and configuring runners to execute automated jobs such as building
and testing the code. The pipeline ensures that every change is tested rigorously before deployment,
reducing errors and improving overall code quality.

By automating repetitive tasks and providing real-time feedback through CI/CD pipelines, this project
highlights the benefits of adopting modern DevOps practices. It illustrates how developers can achieve
faster iteration cycles, proactive bug detection, and seamless deployments.

The results demonstrate a streamlined workflow that fosters collaboration, minimizes manual
intervention, and accelerates the delivery of high-quality software. This project serves as a practical
example of the efficiency and scalability offered by combining Git and GitLab CI/CD in software
development.

4
TABLE OF CONTENTS
TITLE PAGENO
[Link] 06

[Link] 07

[Link] SCREENSHOT 09

[Link] 13

5
1. Introduction
Version control and CI/CD have revolutionized modern software development, enabling teams to work
collaboratively and deliver high-quality software quickly and efficiently. Here's an expanded
explanation of the key concepts and how they come together:

Version Control Systems


Version control systems, like Git, are essential tools for managing changes to source code. They allow
developers to:

Track Changes: Maintain a complete history of modifications, making it easy to identify when and why
changes occurred.

Collaborate: Enable multiple developers to work on the same project without overwriting each other's
work, fostering teamwork.

Revert Issues: Roll back changes to a previous state if errors are introduced, ensuring stability.

Branch and Merge: Facilitate experimentation through branching, allowing developers to work on new
features or fixes independently. Once the work is stable, it can be merged into the main project
seamlessly.

Continuous Integration and Continuous Delivery (CI/CD)


CI/CD pipelines are a cornerstone of modern DevOps practices. They streamline and automate the
processes of building, testing, and deploying applications.

Continuous Integration (CI): Developers frequently integrate code into a shared repository.
Automated tests run on every integration to detect bugs early in the development cycle. This reduces the
time and cost associated with finding and fixing issues.

Continuous Delivery (CD): Builds on CI by automating the deployment of applications to production


or staging environments. This ensures that every change is tested and ready for release at any time.

GitLab CI/CD
GitLab integrates version control and CI/CD capabilities into a single platform, making it a powerful
tool for developers. By using GitLab CI/CD, teams can:

Automate repetitive tasks, such as testing and deployment.

Enforce consistency in build and deployment processes.

Monitor pipeline progress and address failures in real-time.

Deploy code faster and with fewer errors, improving overall productivity and reliability.

6
Relevance of the Project

This project focuses on combining Git's robust version control features with GitLab's CI/CD capabilities
to build a seamless, automated workflow. The primary goals are:

To ensure that code changes are rigorously tested before deployment.

To maintain a collaborative environment where team members can contribute efficiently.

To achieve faster, error-free deployments through automation.

By implementing these practices, organizations can deliver higher-quality software, adapt to changes
quickly, and stay competitive in a fast-evolving technology landscape.

2. Methodology
Step 1: Create a GitLab Account and Repository
The first step in setting up GitLab CI/CD is to create an account and a repository on GitLab.

1. Register on GitLab: Navigate to [Link] and sign up for an account.

2. Create a new repository: Use the GitLab interface to set up a repository for your project.

3. Clone the repository: Use the following command to clone the repository to your local machine:
git clone [Link]

Step 2: Write Sample Code


In this step, you will create a simple application and write basic unit tests for it. These tests ensure that the code
works as expected before deployment.

1. Develop the application: Write a basic program in a language of your choice (e.g., Python, JavaScript).

2. Write unit tests: Implement test cases to validate the functionality of your application.

3. Commit and push the code to the repository using the following commands:
git add .
git commit -m 'Initial commit'
git push origin main

7
Step 3: Create .[Link] File
The .[Link] file is the core configuration file for the CI/CD pipeline. It defines the stages and jobs to be
executed.

1. Create the file: Add a new file named .[Link] to your project repository.

2. Define pipeline stages: Specify the stages in the pipeline, such as build and test. Example configuration:
stages:
- build
- test

build:
stage: build
script:
- echo 'Building the project...'

Step 4: Set Up Runners


Runners are agents in GitLab that execute the jobs defined in the .[Link] file. By default, GitLab provides
shared runners, but you can also configure custom runners.

1. Shared Runners: These are available by default and can execute jobs without additional configuration.

2. Custom Runners: If your project has specific requirements, you can set up custom runners.

Step 5: Push Code and Trigger the Pipeline


Once the code is pushed to the repository, GitLab automatically triggers the pipeline based on the .[Link]
configuration. The pipeline progress can be monitored in the Pipelines section.

Check the status of each stage (build, test, deploy) to ensure the pipeline completes successfully.

8
3. Output Screenshots

9
10
11
4. Conclusion
12
The integration of version control systems like Git with automation tools such as GitLab CI/CD
represents a significant advancement in modern software development. This project demonstrates the
effectiveness of combining these technologies to streamline workflows, enhance collaboration, and
ensure reliable code delivery.

Key Achievements

Version Control Mastery: By leveraging Git, developers can maintain an organized history of changes,
experiment with features using branches, and resolve conflicts efficiently. This approach ensures that
the development process is both systematic and traceable.

Automation of Workflows: The implementation of GitLab CI/CD pipelines automates repetitive and
critical tasks, such as building, testing, and deploying code. This minimizes human error, improves
consistency, and saves valuable time.

Early Bug Detection: Continuous Integration ensures that every code change is tested immediately.
This proactive approach identifies bugs at an early stage, reducing the cost and effort associated with
fixing them later in the development lifecycle.

Seamless Deployment: Continuous Delivery enables automated deployments, ensuring that software
updates are consistent, reliable, and ready for release at any time.

Practical Implications
The practices demonstrated in this project are not limited to a single application but can be scaled and
adapted to suit projects of varying sizes and complexities. Teams adopting these methodologies benefit
from improved communication, faster iteration cycles, and a stronger focus on delivering value to end-
users.

Future Scope
While this project showcases the foundational principles of Git and GitLab CI/CD, there are
opportunities to expand its capabilities further:

Advanced Testing: Integrate additional testing tools to perform performance, security, and stress testing
within the CI/CD pipeline.

Containerization: Use Docker to containerize applications, making deployments more portable and
scalable.

Infrastructure as Code: Employ tools like Terraform to manage infrastructure alongside the
application code, creating a unified deployment process.

Monitoring and Feedback: Integrate monitoring tools to track application performance post-
deployment, enabling continuous improvement.

13

You might also like