Course contentsShow
← Software Engineering
Lesson 701 of 1,93322. Continuous Delivery and DeploymentFree lesson

Pipeline Stages and Ordering

Organizing pipeline stages in the correct sequence: build, unit tests, integration tests, acceptance tests, and deployment.

Pipeline Stages and Ordering

You'll learn how to organize your deployment pipeline stages in the correct sequence to catch problems early and deploy confidently.

The Right Order Matters

A deployment pipeline isn't just a collection of checks—it's a carefully ordered sequence. Each stage acts as a quality gate, and the order determines how quickly you get feedback and how efficiently you use resources.

Think of it like airport security: you check your boarding pass before going through the full body scanner, because that's faster and cheaper. Similarly, you run fast tests before slow ones, and cheap checks before expensive ones.

The Standard Stage Sequence

Here's the proven order that most teams follow:

1. Build Stage
Compile code, resolve dependencies, and create artifacts. If the code doesn't compile, nothing else matters. This is your fastest gate.

2. Unit Tests
Run isolated tests that execute in seconds or minutes. These catch logic errors and broken contracts without touching external systems.

3. Integration Tests
Test how components work together with databases, APIs, or services. Slower than unit tests, but verify real interactions.

4. Acceptance Tests
Execute end-to-end scenarios that validate business requirements. These are typically the slowest automated tests but confirm the system works as intended.

5. Deployment
Push the validated artifact to production or staging. Only code that passed all previous gates reaches this point.

Why This Order?

Each stage is slower and more expensive than the last. You want to fail fast with quick checks before investing time in slow ones. A failing unit test stops the pipeline in minutes; waiting until acceptance tests would waste an hour.

Key Takeaway:
Order pipeline stages from fastest-to-slowest and cheapest-to-most-expensive: build → unit tests → integration tests → acceptance tests → deployment. This maximizes feedback speed and minimizes wasted resources.