Artifact Promotion Patterns
What you'll learn: How to move build artifacts through different environments without rebuilding, ensuring consistency and reducing risk.
The Core Idea
Imagine baking a cake for a cooking competition. You wouldn't bake a new cake at each judging station—you'd move the same cake through different stages of evaluation. Artifact promotion works the same way: you build your application once, then promote that exact same artifact through your pipeline environments (dev → staging → production) using tags and metadata, never rebuilding.
Why Promote Instead of Rebuild?
Rebuilding an artifact in each environment introduces risk. Code might compile differently, dependencies might change, or environmental factors could create inconsistencies. The artifact that passed all your tests in staging might not be byte-for-byte identical to what you deploy to production—a recipe for "it worked in staging!" disasters.
How Promotion Works
- Single Build: Create your artifact once in the CI phase (JAR, container image, ZIP, etc.)
- Immutable Storage: Store it in an artifact repository with a unique version identifier
- Metadata Tagging: Apply environment-specific tags like
dev-approved,qa-passed, orprod-ready - Promotion Logic: Move the artifact by updating its tags/metadata, not by copying or rebuilding
- Environment Deployment: Each environment pulls the artifact using the appropriate tag
For example, your container image myapp:1.2.3-sha256abc might receive the tag dev-approved after initial tests, then prod-candidate after staging validation, and finally production-latest upon successful deployment.
Tracking the Journey
Promotion patterns rely on recording each artifact's journey through environments—which tests it passed, who approved it, when it moved. This audit trail becomes critical for compliance and troubleshooting.
Key Takeaway: Artifact promotion ensures "build once, deploy many times" by using tags and metadata to track an immutable artifact's progression through environments, eliminating rebuild inconsistencies and providing a clear audit trail.