Documentation · Chapter 18

Rehearse deployment before users depend on it.

This workshop deploys to a staging target, verifies health, simulates a broken release, and restores the previous version.

Every lesson starts from the problem, explains the mechanism, then gives a concrete verification.

LESSON OBJECTIVE

What you will be able to do

Rehearse a staging deployment and failure recovery while recording enough evidence for production.

Prepare staging

Use a staging profile with production-like PHP, extensions, document root, and database family.

phpaml — zsh
aml build
aml deploy:check staging
aml deploy staging --dry-run
aml deploy staging
curl -f https://staging.example.com/health

Deploy and smoke test

Build once, check, dry-run, deploy, inspect status, and run smoke tests from outside the server.

Break, recover, and record

Publish an intentionally failing health check in staging, prove rollback, then write down duration, commands, checksum, and observations.

CHECKPOINT

Before you continue

How long did detection and rollback actually take during rehearsal, and what evidence confirms service recovery?

SUMMARY

What to remember

  • A release is an immutable, identified artifact.
  • Build excludes secrets and publishes integrity evidence.
  • Check and dry-run happen before remote change.
  • Atomic activation and rehearsed rollback reduce outage risk.