What is environment promotion and how does it work in practice?

Answer

Environment promotion is the process of moving the same immutable artifact (Docker image, Helm chart) through a series of environments — typically dev → QA → staging → production — gaining confidence at each stage. The key principle is promote artifacts, not code: once an artifact is built in CI, that exact artifact is what gets deployed everywhere. You never rebuild for different environments; instead, you change configuration (environment variables, feature flags). In practice: CI builds and tags the Docker image with the git commit SHA, deploys to dev for smoke tests, runs integration tests in a QA environment, deploys to staging for acceptance tests and performance benchmarks, and finally (with an approval gate in CD) deploys to production. If the staging deployment reveals a bug, the pipeline stops — the problematic artifact never reaches production. This gives strong confidence that the production deployment will succeed.