Two lessons from the first live release-deploy (vitareba, 2026-07-17):
- /opt/<name>/app is now a symlink; launch.sh's logical pwd made `find` not
descend it → server.js not found → crash loop (~6 min downtime, hotfixed on
the box). The bootstrap now normalizes pwd → pwd -P idempotently for every
app so no other first release-deploy can hit it.
- The single sleep-4 health sample read 'activating/000' on a normal Next cold
boot — a false negative that would auto-rollback healthy deploys. Both
deploy.sh and rollback.sh now poll up to 60s, breaking early on healthy or
on 'failed' (real crash-loop).
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Four DevOps hardening pieces (A+ run):
- ci-gate.sh + hook template: push-deploys WAIT for GitHub CI on the pushed
commit and are BLOCKED on red — prod only receives what CI verified
(was: deploy raced CI; only bypassable local hooks gated prod).
- deploy.sh: releases layout — /opt/<name>/releases/<ts>-<sha> + atomic
app-symlink swap (units unchanged), shared/{.env,launch.sh}, keep-3 prune,
AUTO-ROLLBACK on failed health check. Legacy dirs migrate in place.
- rollback.sh: one-command flip to previous/named release + restart + health.
- apply-schema.sh: prisma branch (prisma migrate deploy when prisma/migrations
exists) — covers aoz/datacat (tracked) + reparaturbonus/solon (baselined +
resolved on prod today).
- deploy-hetzner.sh: fleetcrown itself now schema-gates via the shared applier
(39-file set; drizzle journal desync documented in-line — number new
migrations by hand 0040+ until reconciled).
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>