RousselTMLEARNING

TP · DevOps: From Discovery to Expertise

Lab: A complete CI/CD pipeline

What you will learn in this TP
  • Write a test → build workflow
  • Add a security scan
  • See a test fail

The pipeline #

What you will learn in this section
  • Write a test → build workflow
  • Add a security scan
  • See a test fail

Context. A team ships by hand, with frequent mistakes and painful rollbacks. A CI/CD pipeline automates tests, build and publishing on every change: you build a complete one and see how it blocks a faulty change.

Prerequisites: A GitHub (or GitLab) account, Docker  ·  Estimated time: 45 min

From application to registry.
  1. 1. A testable application

    Why? A unit test is the pipeline's safety net: without it, automating deployment only automates mistakes.

    Create a small API and a unit test.
  2. 2. Dockerfile and workflow

    Why? The "build needs test" dependency guarantees an image is never published if tests fail.

    Write the workflow: tests then image build.
  3. 3. Add a security scan

    Why? Integrating security in the pipeline (shift-left) finds a vulnerability at build time rather than in production.

    Fail the pipeline on critical vulnerabilities.
  4. 4. Observe and fix

    Why? Deliberately breaking a test proves the pipeline does its job: it blocks the change and protects the main branch.

    Deliberately break the test, see it fail then fix it.

Difficulty level : ●●○○○ (2/5)

My progress

  • ⏱ Estimated time : ≈ 45 min

Sign in to track your progress and take notes. Sign in

💬 Questions about this lesson

No questions yet: be the first to ask for help or share your configuration.

Ask a question about this lesson →

Recommended Articles

DevOps best practices: culture, CI/CD, infrastructure as code and measurement

DevOps best practices: culture and collaboration, continuous integration and delivery, trunk-base...

End-to-end CI/CD (5/5): GitHub Actions, GitLab CI, Jenkins and Argo CD in practice

Compare and use CI/CD tools: GitHub Actions, GitLab CI, Jenkins, Argo CD and Flux; a complete pip...

End-to-end CI/CD (1/5): principles and anatomy of a pipeline

Understand end-to-end CI/CD: continuous integration, continuous delivery and continuous deploymen...

End-to-end CI/CD (2/5): continuous integration, testing and quality

Succeed with continuous integration: the test pyramid, unit, integration, contract and end-to-end...

End-to-end CI/CD (4/5): deployment strategies and rollback

Deploy without downtime and without risk: recreate, rolling update, blue/green, canary, feature f...

End-to-end CI/CD (3/5): artifacts, registries and environments

Deliver continuously: immutable, versioned artifacts, image and package registries, promoting the...

DevSecOps: securing the software supply chain end to end

Integrate security into the DevOps pipeline: shift-left, threat modeling, secret detection, SAST,...

k6 in continuous integration and on Kubernetes (k6-operator)

Automate performance tests: k6 in GitHub Actions and GitLab CI with blocking thresholds, distribu...

Terraform in CI/CD: pipelines, plan review, OIDC and GitOps

Automate Terraform: plan pipeline on merge requests and apply after approval, posting the plan as...

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!