Skip to content
Français
Account: not signed in, sync available My learning
Select theme
Français

GitLab CI/CD course: from first pipeline to secure production

  • 20 min

By updated

Improve this page

GitLab logo

Does your GitLab CI/CD pipeline fail, does a job sit on "pending", or do your builds take 20 minutes when they could take 5? This progressive course takes you from your first .gitlab-ci.yml to industrial, secure and measurable pipelines. Each lesson builds on the previous ones, with hands-on exercises and real production incident scenarios.

The course is free and open to everyone. It is aimed at developers, DevOps engineers, SREs and platform teams. You need the basics of Git, some habit of using a Linux terminal, and a machine able to run a virtual machine: the labs set up your own GitLab CE forge on it, with no account on gitlab.com. Its first goal is to prepare you for the GitLab Certified CI/CD Associate certification.

What you will learn

  • Write a complete, clear and maintainable GitLab CI/CD pipeline
  • Debug the common failures: pending jobs, skipped pipelines, ineffective cache
  • Scale up your workflows with templates, DAGs, parallelism and parent/child pipelines
  • Secure secrets, deployments and the CI supply chain (SBOM, attestations)
  • Steer delivery with DORA metrics and compliance policies (pipeline execution policies; compliance pipelines are deprecated)

Which GitLab certification should you prepare?

This course does not stop at explaining GitLab CI/CD: it helps you build a progression that is useful in real situations and prepare the most relevant GitLab certifications for your profile.

CertificationWho is it for?How it fits with this course
Git AssociateBeginners without solid Git basicsA good upstream stepping stone, to be completed by real Git practice
GitLab Certified Fundamentals AssociateUsers who want an overview of GitLabPartly covered; complete it with the platform features outside CI/CD
GitLab Certified CI/CD AssociateMain target of this courseStrong match with levels C1 to C3
GitLab security certificationsDevSecOps / security profilesA good base with level C4, depending on the exam you aim for

Target certification: GitLab CI/CD Associate

If your goal is to master GitLab CI/CD and be able to prove it, the certification that fits this course best is the GitLab Certified CI/CD Associate. The GitLab CI Fundamentals Learning Path is the official preparation path.

Levels C1 to C3 cover the skills the exam expects:

  • pipeline structure and .gitlab-ci.yml syntax
  • runners, variables, artifacts and cache
  • rules, templates, includes and components
  • common troubleshooting and DRY best practices

Two pages of the course are dedicated to this preparation: the overview of GitLab certifications, which compares the paths and helps you pick the right order, and the guide Preparing for GitLab CI/CD Associate, which details the skills assessed, a preparation plan and the mistakes to avoid on exam day.

Going further: security and governance

Level C4 extends this progression to security, compliance, audit and CI/CD supply chain topics. It is a good base for profiles who want to strengthen their DevSecOps level in GitLab before aiming for a GitLab security certification.

C1, Write a pipeline and read its failures

Level C1 takes you from "a pipeline that prints Hello World" to a pipeline you can read when it fails. You will learn to structure your .gitlab-ci.yml files, manage variables, control execution with rules, use artifacts and cache, and read the logs of a failing job. The lessons are listed in course order. Every lesson that teaches a hands-on move carries its lab at the bottom of the page, on a GitLab CE forge of your own: there is no separate exercise series to follow alongside the course.

LessonDifficultyFocus
Getting started with GitLab CI/CDBeginnerpipeline, stage, job
Writing a .gitlab-ci.yml fileBeginnerstages, jobs, script, image
Validating a pipelineBeginnerCI Lint, Pipeline Editor, API
Debug: reading the logsBeginnerlogs, sections, errors
Runners: how a job runsBeginnerrunner, tags, executor
Artifacts and cacheBeginnerstorage, performance, retention
Variables and secretsBeginnervariables, scopes, CI_*
Execution conditions (rules)Intermediateworkflow:rules, rules, when
Pipeline triggersIntermediateMR, tags, schedules, API

C2, Deliver

Level C2 moves from writing to delivering. You declare deployment environments, use job reports (JUnit, coverage, quality), publish to the GitLab registries, enable the built-in scanners, and learn to debug the two most frequent failures: the job stuck on "pending" and the "skipped" pipeline. The summary assembles everything into a complete, clean pipeline.

LessonDifficultyFocus
Environments (deploy targets)Intermediateenvironment:name, stop actions
Quality reportsIntermediateJUnit, coverage, code quality
Debug: job stuck on pendingIntermediaterunner, tags, quotas
Debug: skipped pipelineIntermediaterules, workflow, only/except
Summary: a complete pipelineIntermediateC1 and C2 mini-capstone
GitLab registries: images and packagesIntermediateContainer Registry, Package Registry, pinning
GitLab CI security scannersIntermediateSAST, DAST, secrets, dependencies

C3, Industrialise

Level C3 turns your hand-made pipelines into industrial pipelines: fast thanks to the DAG and parallelism, reusable thanks to templates and CI/CD Components, and orchestrated with parent/child and dynamic pipelines.

LessonDifficultyFocus
extends and YAML anchorsIntermediateanchors, extends, merge keys
Shared templates (include)Intermediateinclude project/remote
CI/CD Components and CatalogAdvancedinputs, versioning, governance
DAG and parallelism (needs)Advancedgraph, performance, fail-fast
Job matrices (parallel:matrix)Advancedmulti-version tests
CI services and advanced cacheAdvancedDocker services, distributed cache
Parent-child pipelinesAdvancedsplitting, orchestration
Dynamic pipelinesAdvancedYAML generation, monorepo
Multi-project and downstreamAdvancedtriggers, variable propagation
CI/CD workflowsAdvancedMR, branches, releases
Pipeline reliabilityAdvancedtargeted retry, timeouts, idempotence
Scaling-up capstoneAdvancedfast, modular pipeline

C4, Secure and tool

Level C4 covers securing your CI/CD pipelines: a realistic threat model, secrets management, configuration hardening, the supply chain (SBOM, SLSA attestations) and compliance (audit, compliance frameworks, pipeline execution policies; compliance pipelines are deprecated).

LessonFocus
7 attacks that target your pipelinesCI/CD threat model, injection, exfiltration
Managing secrets without exposing themProtected variables, masking, Vault integration
Protected branches and approvalsMerge request approvals, protected environments
Hardening your pipelines in 10 measuresLeast privilege, runner isolation, image pinning
Supply chain: SBOM and attestationsCycloneDX, SLSA, cosign, traceability
Audit, compliance and traceabilityAudit events, compliance frameworks, pipeline execution policies (compliance pipelines are deprecated), reports

Incident scenarios (cross-cutting)

Throughout the course you will meet incident scenarios taken from production. The goal: learn to make a diagnosis before applying a fix, exactly as in a real setting.

#SymptomActual causeLevel
1Job stuck on "pending"No runner, or tags mismatchC2
2No pipeline created by the pushworkflow:rules too restrictiveC2
3Builds always slowCache key not tied to the lockfileC1
4Next job failsWrong artifacts paths/expire_inC1
5Unexpected behaviorVariable scope/precedenceC1
6Tests "randomly red"Flaky tests, network dependenciesC3
7Jobs start too earlyneeds badly defined (DAG)C3
8Secrets exposed in logsEcho + no maskingC4

Where should you start?

The entry point depends on what you can already do. Pick the tab that matches your situation: it names the exact lesson to start with.

Follow the lessons in order, starting with level C1. Take the time to practice each concept before moving on to the next.

First lesson: Getting started with GitLab CI/CD

Tools

The tools belong to level C4. Two utilities come up constantly in the course: glab, to drive GitLab without leaving the terminal, and Plumber, to check your .gitlab-ci.yml files before you push them.

ToolDescription
GitLab CLI (glab)Manage pipelines, MRs and issues from the terminal
PlumberCompliance scanner for .gitlab-ci.yml files

Additional resources

Keep these four pages at hand during the course: the .gitlab-ci.yml reference and the list of predefined variables answer most syntax questions on their own.

Key takeaways

  • GitLab CI/CD is learned progressively: a simple pipeline first, scaling up next, security last
  • A good pipeline is readable, fast, reusable and secure
  • Debugging is a skill in its own right: pending jobs, skipped pipelines and ineffective cache each have specific causes
  • Scaling up relies on templates, CI/CD Components and the DAG, not on duplicated code
  • CI/CD security is not optional: exposed secrets, unpinned images and unaudited pipelines are real attack vectors
  • This course prepares you for the GitLab Certified CI/CD Associate, with bridges to Git Associate and the GitLab security certifications

Is this project useful to you?

The guides, courses, quizzes and labs stay free. If you use them regularly, you can contribute to their upkeep and development.

Become a supporting member (new tab) One-time support (new tab) Learn more

Follow the project on LinkedIn