RousselTMLEARNING

TP · GitLab CI/CD: from discovery to expertise

Lab: First GitLab CI pipeline

What you will learn in this TP
  • Create a project and its pipeline
  • Use cache, artifacts and JUnit reports
  • Avoid duplicate pipelines with workflow:rules
  • Read a pipeline and a failed job
Mode :

All steps and instructions are shown. Recommended for this lab: guided

Introduction #

Context. Your team ships the shop by copying files by hand. You set up continuous integration: every push must be checked automatically.

Prerequisites: a free GitLab.com account, Git and Python 3  ·  Estimated time: 40 min

A green lint → test → build pipeline, with a test report visible in GitLab and a downloadable artifact.

Setup #

Guided steps, with their solution.

  1. 1. Create the project

    Why? A project testable locally guarantees CI will check the same thing as you.

    Create the boutique service (application, tests, Dockerfile) and run the tests locally.
  2. 2. Push to GitLab

    Why? The remote repository will trigger pipelines.

    Create an empty boutique project on GitLab.com (no README) and push your main branch.
  3. 3. Write the pipeline

    Why? Three simple stages already give fast, reliable feedback.

    Create .gitlab-ci.yml with lint, test (pip cache, JUnit report) and build (archive as artifact, on main only) stages, then push.
  4. 4. Cause and read a failure

    Why? Knowing how to read a failure matters as much as having a green pipeline.

    On a branch, change the default rate to 0.21, open a merge request, look at the pipeline Tests tab, then revert the change.

Validate your work

Check that each goal above is reached and that you get the result described in the introduction.

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

My progress

  • ⏱ Estimated time : ≈ 40 min

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

⭐ Rate this lesson

5.0 initial rating from the teaching team

Sign in to rate this lesson →

💬 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

GitLab CI/CD: concepts and architecture

Discover GitLab CI/CD: the DevSecOps platform, the .gitlab-ci.yml file, pipelines, stages and job...

Writing a .gitlab-ci.yml: jobs, rules, cache and artifacts

Mastering .gitlab-ci.yml syntax: stages, jobs and images, rules and workflow, needs (DAG), cache ...

GitLab runners: types, executors, installation and security

Running GitLab jobs: instance, group and project runners, docker, kubernetes and docker-autoscale...

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...

Building and delivering with GitLab: registry, environments and deployments

Delivering with GitLab CI/CD: building and publishing images to the project registry, package reg...

Reusing and securing GitLab pipelines

Industrializing GitLab CI/CD: extends, anchors and !reference, include, CI/CD components and cata...

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...

GitLab CI/CD best practices and troubleshooting

Running GitLab CI/CD day to day: speeding up pipelines, controlling compute minutes, organizing f...

GitHub Actions: concepts and how it works

Discover GitHub Actions: events, workflows, jobs, steps and actions, the Marketplace, hosted runn...

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!