Chapter 92: GitLab CI Deep Dive
Friends, GitLab CI is the CI/CD system built into GitLab. In chapter 90 you learned GitHub Actions, and chapter 81 had a few GitLab CI projects. This chapter teaches GitLab CI from the ground up: pipelines, stages, jobs, runners, rules, needs, artifacts, cache, variables and secrets, services, Docker builds to the built-in registry, environments with approvals, templates, test reports and troubleshooting. You do not need a GitLab account to follow along. Pipeline outputs are labelled illustrative because no real pipeline was run. Script outputs that were really run on a practice computer are labelled tested.
मित्रांनो, GitLab CI हे GitLab मध्येच असलेलं CI/CD system आहे. Chapter 90 मध्ये तुम्ही GitHub Actions शिकलात, आणि chapter 81 मध्ये काही GitLab CI projects होते. हा chapter GitLab CI पायापासून शिकवतो: pipelines, stages, jobs, runners, rules, needs, artifacts, cache, variables आणि secrets, services, built-in registry ला Docker build, approvals सोबत environments, templates, test reports आणि troubleshooting. Follow करायला GitLab account लागत नाही. खरी pipeline चालवली नाही म्हणून pipeline outputs ला illustrative label आहे. Practice computer वर खरंच चालवलेल्या script outputs ला tested label आहे.
दोस्तों, GitLab CI वो CI/CD system है जो GitLab में ही बना है. Chapter 90 में आपने GitHub Actions सीखा, और chapter 81 में कुछ GitLab CI projects थे. यह chapter GitLab CI को नींव से सिखाता है: pipelines, stages, jobs, runners, rules, needs, artifacts, cache, variables और secrets, services, built-in registry में Docker build, approvals वाले environments, templates, test reports और troubleshooting. Follow करने के लिए GitLab account नहीं चाहिए. असली pipeline नहीं चलाई इसलिए pipeline outputs पर illustrative label है. Practice computer पर सच में चलाए गए script outputs पर tested label है.
What you will learn in this chapter
- Pipelines, stages, jobs and runners
- The .gitlab-ci.yml file, step by step
- Runners and executors, shared vs self-managed, and trust boundaries
- rules and workflow:rules, and stopping duplicate pipelines
- stages vs needs, artifacts and dependencies
- Variables and secrets: protected, masked, hidden — and their limits
- Cache vs artifacts and expiry
- Services for database tests
- Node and Python test jobs
- Docker builds and the built-in container registry
- Environments, manual approval, protected environments and resource_group
- include, extends and reusable templates
- Test reports and troubleshooting
- GitLab CI vs GitHub Actions vs Jenkins
- A full practice repo you can paste, plus interview and revision cards
Where this sits. Chapter 81 has GitLab CI projects. Chapter 90 is the GitHub Actions deep dive. This chapter explains the GitLab CI ideas under those projects. Facts about GitLab features were checked against the official GitLab documentation (docs.gitlab.com) in November 2026. Some features depend on your GitLab tier (Free, Premium, Ultimate); where that matters, the lesson says so.
How to read the outputs. Tested means the job's commands were really run on a practice computer. Illustrative means the usual shape of a GitLab pipeline or job log; no real pipeline was run for this chapter.
Concepts in this chapter
- 92.1Why GitLab CI — pipelines, stages and jobs
- 92.2The .gitlab-ci.yml file — image, before_script, script and default
- 92.3Runners — executors, shared vs self-managed, and trust
- 92.4rules and workflow:rules — when jobs and pipelines run
- 92.5stages vs needs, artifacts and dependencies
- 92.6Variables and secrets — protected, masked, hidden and their limits
- 92.7Cache vs artifacts and expiry
- 92.8Services — a real database for tests
- 92.9Node and Python test jobs, with test reports
- 92.10Docker builds and the built-in container registry
- 92.11Environments, manual approval, protected environments and resource_group
- 92.12include, extends and reusable templates
- 92.13Troubleshooting pipelines
- 92.14Comparison — GitLab CI vs GitHub Actions vs Jenkins
- 92.15Lab — a full practice repo you can paste
- 92.16Interview questions, revision and chapter quiz
The chapter recap is at the end of the last concept page.