The stages of a pipeline

Stages and jobs, the canonical order, parallelism, dependencies as a graph, run conditions, blocking or tolerated failures, duration and critical path, on real .gitlab-ci.yml files.

  • 22 cards
  • 5 topics
  • Free

The outline, topic by topic

Each topic is weighted the way the exam weighs it.

  1. Concepts
  2. Questions
  3. Sort and link
  4. The numbers
  5. Scenarios

A few cards from the deck

  • Pipeline stage: what is it?

    Show the answer

    A group of jobs that run in parallel; the next one starts only if all the jobs of the previous one succeeded.

    The classic order is build, test, analyse, package, deploy: each stage assumes the previous one produced something sound.

  • This file is rejected with "chosen stage does not exist; available stages are .pre, build, test, .post". What is the fix?

    ```yaml
    stages:
    - build
    - test

    deploy:
    stage: deploy
    script:
    - ./deploy.sh
    `

    • Add deploy to the stages list
    • Rename the deploy job to release
    • Add needs: [test] to the deploy job
    • Add allow_failure: true to the job
    Show the answer

    Add deploy to the stages list

    The message lists the known stages: deploy is not one of them. Declaring it in stages, after test, is enough. The job's name, needs or allow_failure change nothing about the requested stage, which stays unknown.

  • In a GitLab CI file, the … list gives the order of the stages, and each job picks its own with the … keyword.

    Show the answer

    In a GitLab CI file, the stages list gives the order of the stages, and each job picks its own with the stage keyword.

    Without stage, a job goes to the test stage by default; a stage name missing from the list is a configuration error.

  • Job: what is it?

    Show the answer

    The unit of work of a pipeline: a script run on a runner, attached to a stage, with its conditions, artifacts and status.

    A stage holds one or more jobs; it is the job, not the stage, that fails or succeeds, runs or is skipped.