Course contentsShow
← Cloud and Infrastructure
Lesson 1667 of 2,98934. CI/CD FoundationsFree lesson

Multi-Environment Promotion

Progress builds through multiple environments (dev, staging, production) with environment-specific configurations and validations.

Multi-Environment Promotion

What you'll learn: How to systematically progress builds through distinct environments—dev, staging, production—with environment-specific configurations and validations at each stage.

The Core Idea

Multi-environment promotion is the practice of moving your application artifact through a series of progressively production-like environments before it reaches end users. Think of it like a relay race where the baton (your build artifact) passes through multiple checkpoints, with each runner (environment) performing specific validations before handing off to the next.

The artifact itself stays unchanged—what changes are the configurations and validation gates applied at each environment.

The Typical Flow

  1. Dev environment: Developers test integrated changes. Fast feedback, minimal validation.
  2. Staging environment: Production-like setup with realistic data volumes and configurations. Automated integration tests, performance checks, security scans.
  3. Production environment: Live user traffic. Final smoke tests, gradual rollout (canary/blue-green), monitoring gates.

Environment-Specific Configurations

Each environment needs different settings:

  • Database connections: Dev uses local databases, staging uses isolated test databases, production uses replicated clusters
  • API endpoints: Different external service URLs per environment
  • Resource limits: Dev runs with minimal resources, production has full scaling
  • Feature flags: Certain features enabled only in specific environments

You inject these using environment variables, configuration files, or secrets management tools—never hardcoded in your artifact.

Validation Gates

Each promotion should require passing specific checks. Staging might require 95% test coverage and zero critical vulnerabilities. Production promotion might need manual approval plus successful canary metrics.

Key Takeaway: Multi-environment promotion reduces production risk by validating the same immutable artifact through progressively stricter environments, each with tailored configurations and validation criteria, ensuring only battle-tested code reaches users.