Understanding why GitLab CI/CD has become the go-to choice at enterprises thanks to one all-in-one platform, then dissecting its core architecture: the GitLab Server, the GitLab Runner, and the declarative .gitlab-ci.yml file along with the stages, jobs, and scripts hierarchy.

In episode 0 you set up the three skill foundations — Git & GitLab workflow, YAML, and bash — plus a complete environment with glab and VS Code. Now it's time to pause the typing for a moment and understand why we're all here. Before writing your first .gitlab-ci.yml, you need to fully grasp how GitLab's architecture is designed, how its components work together, and why GitLab CI has become the primary choice at enterprise companies.
Believe it or not, the biggest mistake beginners make is jumping straight into writing pipeline YAML without understanding the architecture — the result is a pipeline that's just a collection of copy-pasted commands, hard to maintain and hard to debug. This episode builds that conceptual foundation.
GitLab started in 2011 as an open-source Git hosting tool, and in 2016 released the first integrated CI/CD that runs directly inside the platform. The difference compared with other tools: GitLab is a single all-in-one application — not a set of tools stitched together with webhooks. Within one platform you get:
It's like a restaurant: with traditional tools you have to hire separate suppliers for ingredients, the chef, and the cashier. In GitLab everything lives in one kitchen — ingredients come in from commits, recipes are tested by the pipeline, and the results are served through deployments, all within a single application. This is the main reason enterprise teams choose GitLab: one workflow, one source of truth, one team managing it all.
There are three core components you should understand forever:
.gitlab-ci.yml — the declarative file at the repository root that describes the entire pipeline. This file is the "recipe": if it exists in the repository, GitLab automatically reads it and executes it every time an event occurs.| Component | Role | Analogy |
|---|---|---|
| GitLab Server | Metadata, UI, pipeline trigger | Restaurant manager |
| GitLab Runner | Executes jobs | Chef |
.gitlab-ci.yml | Pipeline definition | Recipe |
When a commit is pushed, this is the flow that happens:
Developer pushes commit to GitLab
|
v
GitLab Server detects .gitlab-ci.yml
|
v
Server creates pipeline and queues jobs
|
v
Runner picks up job, checks out code, executes script
|
v
Runner sends log and status back to GitLab Server
|
v
Status appears in UI, merge request, and notificationsInside .gitlab-ci.yml, the pipeline executes based on a three-level hierarchy:
build → test → deploy. All jobs in the same stage run in parallel; the next stage only starts after every job in the previous stage succeeds.unit_test job and a lint job both sitting in the test stage.stages:
- build
- test
- deploy
unit_test:
stage: test
script:
- npm testYou can see the pattern: stages defines the order, unit_test is a job placed in the test stage, and npm test is the script being run. A simple mental picture: a pipeline is a building, stages are its floors, jobs are the rooms on each floor, and scripts are the work done inside those rooms.
To make GitLab's position clear, let's compare it with its two main competitors:
| Aspect | GitLab CI | GitHub Actions | Jenkins |
|---|---|---|---|
| Hosting model | Cloud (SaaS) or self-hosted | Cloud-native, managed by GitHub | Self-hosted (needs your own server) |
| Pipeline definition | .gitlab-ci.yml (YAML) | .github/workflows (YAML) | Jenkinsfile (Groovy) |
| VCS integration | Native in GitLab | Native in GitHub | Needs plugins and webhooks |
| All-in-one platform | Yes (SCM, issues, registry, security) | Partial (SCM + Actions) | No (CI/CD only) |
| Runner | GitLab-hosted, shared, self-hosted | GitHub-hosted + self-hosted | Agents managed by yourself |
| Best for | Teams wanting one end-to-end platform | Teams already living in GitHub | Large teams with their own infrastructure |
No choice is absolutely wrong — Jenkins is still great for full control, and GitHub Actions shines for teams in the GitHub ecosystem. GitLab CI is chosen when you want a single application to handle the entire development flow, from repository to security dashboard, without the cost of integrating tools together.
Note
The terms "stage", "job", "script", and "runner" will become your daily vocabulary. Don't worry if they still feel abstract — starting in episode 2 we'll turn all these concepts into YAML files that actually run.
In this episode 1, you've built important conceptual foundations:
.gitlab-ci.yml as the declarative pipeline definition.Now you know how the architecture works, it's time to understand how to write it. In episode 2 we'll create your first .gitlab-ci.yml with the basic syntax: global keywords, stages definition, job structure, inline and multi-line scripts, and allow_failure for handling errors. See you in episode 2!