Deployment Checklist

Repeatable steps to promote VelvetCMS builds to production.

Category: Operations

1. Build + dependencies #

This checklist assumes you’re familiar with the commands in CLI → Core Commands.

composer install --no-dev --optimize-autoloader
./velvet module:compile
  • Composer autoloader optimization plus the module autoloader keeps bootstrap snappy.
  • Run module:compile after toggling modules or updating manifests (CI can fail the build if validation errors occur).

2. Cache warm-up #

./velvet cache:clear
./velvet config:clear && ./velvet config:cache
./velvet route:clear && ./velvet route:cache
./velvet optimize

Sequence rationale:

  1. Clear stale cache files (storage/cache/*).
  2. Regenerate consolidated config.php.
  3. Compile routes so public/index.php loads them instantly.
  4. optimize script warms configs again and checks APP_ENV/APP_DEBUG sanity.

3. Database migrations #

./velvet migrate --force
  • In production you’ll be prompted unless --force is passed. Back up data or run inside a transaction for large migrations.
  • You can scope to module migrations using --path=modules/acme-blog/database/migrations.

4. Smoke tests #

  • Hit ./velvet diagnose to ensure cache, storage permissions, DB connectivity, content driver, and modules are healthy.
  • Curl /themes/<theme>/assets/... to verify the asset route sends Cache-Control and ETag headers as expected.

5. Runtime toggles #

  • Ensure .env contains APP_ENV=production. Anything else is treated as the permissive “local” mode.
  • Confirm APP_DEBUG is false (it defaults to false when APP_ENV=production, but double-check if you override it manually).
  • Rotate secrets (DB password, Redis password) through environment variables rather than editing config files.

6. Monitoring hooks #

  • diagnose --json is CI-friendly; stash its output as a deployment artifact.
  • Tie exception reporting into your logging stack by binding a PSR-3 logger and adding reporters in config/exceptions.php.

Following these steps gives you deterministic, cache-warmed deployments with module compatibility verified before traffic hits the node.