Jobs and Stages
Part of the GitLab CI course
Your pipeline from the last lesson had one job. Real projects never stay that small. A real project compiles code, runs a unit test suite, runs a linter, maybe runs an integration test suite, and then deploys, and every one of those things is its own job. The moment you have several jobs, a new question appears that a single job never raised: what order do they run in, and which ones can happen at the same time?
Get the order wrong and you waste time or, worse, waste correctness: deploying before the tests have even started defeats the entire point of having tests. This lesson is about stages, the mechanism GitLab CI uses to control that order, and about needs:, the escape hatch for when stage order is stricter than what you actually need. ...
Want to learn GitLab CI Jobs and Stages in a real environment?
Click below, get a fresh Linux box with GitLab CI ready to go, and work through Jobs and Stages hands-on with an AI tutor that knows your code.
Start this lessonJobs and StagesWhat you'll learn
- Default stages
- Stage keyword
- Parallel jobs in same stage
- Stages keyword
- Needs for DAG
- Job ordering
Read this lesson in your language
All lessons in this course
11 lessons- 1What Is CI/CD20 min
- 2Your First Pipeline25 min
- 3Jobs and Stages30 min
- 4Variables and Secrets30 min
- 5Artifacts and Caches30 min
- 6Rules and Conditional Jobs30 min
- 7Docker Jobs and Services35 min
- 8Environments and Deployments30 min
- 9Includes and Templates30 min
- 10Runners30 min
- 11Capstone: Build, Test, Deploy60 min
