Compare Deployment Configurations Before and After Release
Compare deployment artifacts, configurations, and infrastructure-as-code changes between releases. Learn how to audit what changed between production deployments for safe releases.
Detailed Explanation
Deployment Diff
Comparing deployment configurations between releases is a critical safety practice. By diffing everything that changed — application code, configuration files, environment variables, infrastructure definitions — you can predict the impact of a deployment before it happens.
What to Diff Before Deploying
| Artifact | Format | What to Check |
|---|---|---|
| Application code | Source files | Logic changes, new endpoints |
| Environment variables | .env files | New/changed variables |
| Docker images | Dockerfile | Base image, dependencies |
| K8s manifests | YAML | Resource limits, replicas |
| Database schema | SQL/migrations | Schema changes |
| Dependencies | package.json, go.mod | Version bumps, new deps |
| CI/CD pipeline | YAML | Build/deploy step changes |
Release Comparison
# Compare two Git tags
git diff v1.2.3..v1.2.4 --stat
# Output
src/api/users.ts | 15 +++++++----
src/config/database.ts | 3 ++-
docker-compose.yml | 8 ++++++
.env.example | 2 ++
k8s/deployment.yaml | 5 ++--
package.json | 3 ++-
6 files changed, 28 insertions(+), 8 deletions(-)
Infrastructure Diff
For Infrastructure-as-Code (Terraform, Pulumi, CloudFormation):
resource "aws_instance" "web" {
- instance_type = "t3.small"
+ instance_type = "t3.medium"
ami = "ami-0123456789"
+ monitoring = true
}
Use terraform plan to see the actual infrastructure changes:
~ aws_instance.web
instance_type: "t3.small" → "t3.medium"
+ monitoring: true
Docker Image Diff
Compare layers between image versions:
# Compare image sizes and layers
docker history app:v1.2.3 > old.txt
docker history app:v1.2.4 > new.txt
diff old.txt new.txt
Deployment Checklist from Diff
After reviewing the diff:
- Environment variables — are all new variables set in production?
- Database migrations — is the migration safe? Reversible?
- Dependencies — any known vulnerabilities in new versions?
- Breaking API changes — will downstream services be affected?
- Resource requirements — do scaling settings need adjustment?
- Rollback plan — can you revert if something goes wrong?
Automated Deployment Diff
Many teams automate deployment diffs in their CI/CD pipelines, generating a "deployment manifest" that lists every change between the current and target versions.
Use Case
Deployment diff is used by release managers, DevOps engineers, and on-call teams to understand exactly what is changing in each release. It is critical for incident prevention — many production outages are caused by unreviewed configuration changes. Teams with strong deployment diff practices have fewer deployment-related incidents.