Course contentsShow
← Cloud and Infrastructure
Lesson 1868 of 2,98939. GitOps PrinciplesFree lesson

Environment Promotion Patterns

Move changes through dev, staging, and production environments using Git operations and automation.

Environment Promotion Patterns

What you'll learn: How to safely move infrastructure changes from development through staging to production using Git-based workflows.

In GitOps, environment promotion means advancing configuration changes through multiple stages—typically dev → staging → production—using Git operations like merges, pull requests, or branch updates to trigger automated deployments.

Core Idea

Think of environment promotion like a manuscript moving from a writer's draft to an editor's review, then to the publisher's final print. Each stage has stricter quality gates, and you never skip steps.

With GitOps, each environment corresponds to:

  • A branch (e.g., dev, staging, main)
  • A directory (e.g., environments/dev/, environments/prod/)
  • Or a separate repository entirely

When you're ready to promote, you use standard Git operations:

Branch-based promotion:

# Merge dev branch into staging
git checkout staging
git merge dev
git push origin staging

Directory-based promotion:

# Copy tested manifests from dev to staging folder
cp environments/dev/app-deployment.yaml environments/staging/
git commit -m "Promote app v1.2.3 to staging"
git push

The GitOps agent (like Argo CD or Flux) watches each environment's path or branch and automatically reconciles changes—deploying to the corresponding cluster when it detects updates.

Why This Matters

Environment promotion patterns enforce:

  • Audit trails: Every promotion is a Git commit with author and timestamp
  • Rollback capability: Revert a commit to undo a promotion
  • Progressive validation: Test in lower environments before production
  • Separation of concerns: Staging and prod never share the same manifests directly

Key Takeaway:
Environment promotion in GitOps uses Git merges, commits, or PR approvals to systematically advance changes through environments, ensuring every deployment is tracked, tested, and reversible through version control.