deployment and operations
CI/CD Deployment Pipeline Basics
A deployment pipeline turns a reviewed commit into a verified release. Keep artifact creation, tests, migration strategy, deployment, health checks, and rollback explicit.
Promote One Release Artifact
- Build or select one immutable release artifact.
- Run checks before promotion.
- Deploy with migration and rollback planning.
Treat Deployment As A Verified Sequence
- Promote to staging.
- Run smoke and health checks.
- Deploy production with release record.
Plan For Migrations And Rollback
- Building separately in each environment introduces drift.
- Migrations can make rollback harder.
- Success exit without health verification is incomplete.
Pipeline Stages
validate -> test -> package -> deploy staging -> smoke test -> approve -> deploy production -> health check -> monitor -> rollback if needed
The pipeline is ready when the same release can be promoted and rolled back predictably. A successful command exit is not enough: health checks and a short observation window should prove that the serving application is healthy.
Practice
Practice: Sketch A Deployment Pipeline
Sketch the release stages for a PHP web application with database migrations and a rollback requirement.
Requirements
- Build or select one immutable release artifact.
- Run checks before promotion.
- Deploy with migration and rollback planning.
- Promote to staging.
- Run smoke and health checks.
- Deploy production with release record.
Show solution
Validate, test, and package one immutable release. Promote that same artifact to staging, run migrations with a deliberate compatibility plan, and execute smoke plus health checks before production approval.
Record the production release, observe health after deployment, and keep rollback steps available. Database changes need special care because application rollback may not automatically undo a migration.