CD phase 2 — host deployer with AUTO_DEPLOY=off #12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
deploy/lib/deployer.sh (tick/apply/rollback/status/backup, --dry-run) and deployer-decide.sh; nectenda-deploy.service/timer; deploy.env per host; Kuma push monitor and a per-host manual maintenance (status page banner during the gap, incident on failure) toggled via a bundled socket.io client run with the image's Node; install-deployer.sh for existing hosts; cloud-init for new ones; docs. Checkpoint: hand apply on accounts then eu1 with gap logged, banner visible during and gone after, one rollback exercised on eu1, push monitor green.
Done and verified live. Commits
23db287(the deployer) and69a8317(the banner fix and the measured numbers).What is on the hosts.
deploy/lib/deployer.shplusnectenda-deploy.timeron bothaccountsandeu1, ticking every 60 s,AUTO_DEPLOY=offas this phase specifies. Config in/srv/<app>/deploy.env, root-only 0600. Installed and upgraded bydeploy/install-deployer.sh; new hosts get everything but the Kuma bundle from cloud-init withAUTO_DEPLOY=on.Checkpoint. All four deploys run by hand, readiness probed through Caddy at 2/s throughout each one.
4446a33→23db2874446a33→23db28723db287→4446a33(rollback)4446a33→23db287(back)/api/healthconfirmed the version each way round, including the rollback. Both push monitors are green and report the running sha and:stable unresolved, which is correct until phase 3.One real bug, found by doing this rather than by the tests. The first live deploy raised no banner and logged only "kuma maintenance on failed (not fatal)". The deployer was mounting the bundle directory over the container's
/lib, which shadows the dynamic linker and libc, sonodedied before reading the bundle. Two things made it survive review: the output was sent to/dev/null, and the failure was non-fatal by design. Now mounted at/opt/nectenda-deploy, the client's output is logged, and a test asserts the bundle is never mounted at/lib.Tests.
deploy/is a workspace package; 13 tests covering the decision truth table, the dry-run plan and its ordering, the.envpin, the rollback, the refusal to roll back after a migration, and the refusal to deploy without a backup. Five mutations each fail the suite: ignoreAUTO_DEPLOY, ignore the identity gate, raise the banner after the restart instead of before, roll back after a migration, mount the bundle at/lib.Also fixed along the way. The cloud-init template's header comment spelled out its own placeholder names, so every payload was substituted twice and the rendered user-data was 16 KB over Hetzner's 32 KiB limit; both provisioning scripts now measure it.
kuma-monitor.mjsgainedpush,maintenanceandpush --rotate.Next: phase 3 (#13) creates the
:stabletag, which is what turns this from a hand tool into a pipeline.