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.
- Concepts
- Questions
- Sort and link
- The numbers
- 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
deployto thestageslist - Rename the
deployjob torelease - Add
needs: [test]to thedeployjob - Add
allow_failure: trueto the job
Show the answer
Add
deployto thestageslistThe message lists the known stages:
deployis not one of them. Declaring it instages, aftertest, is enough. The job's name,needsorallow_failurechange nothing about the requested stage, which stays unknown.- Add
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 theteststage 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.