GitLab's Inception: Tracing the Start of a Powerful Tool - part 1

GitLab is an all-in-one DevOps platform that lets you manage your repositories, CI/CD pipelines, secrets, runners, and deploymentsโeverything under one roof.
๐ What You'll Learn
What is GitLab?
How is GitLab different from GitHub/Bitbucket?
How to use GitLab?
Creating and managing projects & groups
Building pipelines with
.gitlab-ci.yml
Secrets, Variables, and Artifacts
Self-hosted vs SaaS Runners
Deploying projects via GitLab CI/CD
๐ฐ What is GitLab?
GitLab is a web-based Git repository manager with features for issue tracking, CI/CD, and more. It allows you to plan, build, test, and deploy in one unified platformโperfect for DevOps workflows.
๐ GitLab vs GitHub vs Bitbucket
Feature | GitLab | GitHub | Bitbucket |
CI/CD | Built-in | Third-party (e.g., Actions) | Integrated |
Self-hosting | Yes | Limited (via GitHub Enterprise) | Yes |
Free Private Repos | Yes | Yes | Yes |
DevOps Lifecycle | Complete platform | Limited to code & actions | Partial |
๐ ๏ธ Getting Started with GitLab
1. Create EC2 instance and set up your local machine.
2.Learn how Groups and Projects (Repos) are structured.
URL:
gitlab.com/group_name
/project_name
Example:
gitlab.com/harsh/node-tod-cicd
3.Connect to EC2 using an SSH key.
4.Understand how to import GitHub repos into GitLab using the project URL.
๐ GitLab CI/CD Basics
To set up CI/CD, create a file named .gitlab-ci.yml
in the root of your repo.
This YAML file defines:
Pipeline โ List of stages
Stages โ Sequence of execution (e.g., build, test)
Jobs โ Tasks executed inside stages
Sample Pipeline Flow
stages:
- build
- test
- push
- deploy
build-job:
stage: build
script:
- echo "Building..."
test-job:
stage: test
script:
- echo "Running tests..."
push-job:
stage: push
script:
- echo "Pushing code..."
deploy-job:
stage: deploy
script:
- echo "Deploying..."
๐ Runners in GitLab
Runners are the agents that execute your CI/CD jobs.
GitLab provides shared runners by default.
You can also self-host your own runners.
you can copy and paste this script given at top right corner inside your server with after
sudo su
// gives you super user access
//after this cmd copy that scrpit provided by how to install gitlab runners? inside Register runners
๐ Variables & Secrets
GitLab supports both inbuilt and user-defined variables.
Secrets can be masked and encrypted for safe usage.
Use these variables in your
.gitlab-ci.yml
for dynamic configurations.
๐ฆ Artifacts
Artifacts are the outputs of your CI/CD jobs.
Examples:
Logs
Reports
Compiled binaries
They can be shared between jobs and stages for better traceability.
๐ Branching Strategy & Tagging
you can follow a simple branching model:
main โ dev โ prod โ feature
You can also create tags during pipeline runs to mark versions based on releases or environments.
Subscribe to my newsletter
Read articles from Harshal Thorat directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Harshal Thorat
Harshal Thorat
Software Developer successfully implemented DevOps principles