Ravindra BagaleCourses & study guides मराठी

DevOps

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.

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

  1. 92.1Why GitLab CI — pipelines, stages and jobs
  2. 92.2The .gitlab-ci.yml file — image, before_script, script and default
  3. 92.3Runners — executors, shared vs self-managed, and trust
  4. 92.4rules and workflow:rules — when jobs and pipelines run
  5. 92.5stages vs needs, artifacts and dependencies
  6. 92.6Variables and secrets — protected, masked, hidden and their limits
  7. 92.7Cache vs artifacts and expiry
  8. 92.8Services — a real database for tests
  9. 92.9Node and Python test jobs, with test reports
  10. 92.10Docker builds and the built-in container registry
  11. 92.11Environments, manual approval, protected environments and resource_group
  12. 92.12include, extends and reusable templates
  13. 92.13Troubleshooting pipelines
  14. 92.14Comparison — GitLab CI vs GitHub Actions vs Jenkins
  15. 92.15Lab — a full practice repo you can paste
  16. 92.16Interview questions, revision and chapter quiz

The chapter recap is at the end of the last concept page.