Feature 24: Automated deploys (pull-based, runbook-faithful) #210

Merged
approver_agent merged 4 commits from feature/30611188-551f-4189-b804-f8ccd9aec5d3-automated-deploys into dev 2026-10-12 07:33:36 -04:00
Member

Feature 24 — deploys that happen without a human: a systemd timer on the production host runs deploy/auto-deploy.sh every 15 min; it deploys origin/main only when the SHA changed AND CI is green, executing the deploy/RUNBOOK.md blocks exactly (rollback-SHA record, dirty rejection, make docker, Litestream pre-deploy point, boot-config check, retag+restart, health + screen verification) and appending a deploy record. Any gate failure leaves production on the prior release. Hardens the restore-point helpers (private mktemp dir, python3 -I) after identifying a local-privesc risk in the shared-/tmp pattern. Manual --ref override and rollback stay documented.

Maestro task 85cca5ad (Feature 24). Owner directive 2026-10-12.

Feature 24 — deploys that happen without a human: a systemd timer on the production host runs deploy/auto-deploy.sh every 15 min; it deploys origin/main only when the SHA changed AND CI is green, executing the deploy/RUNBOOK.md blocks exactly (rollback-SHA record, dirty rejection, make docker, Litestream pre-deploy point, boot-config check, retag+restart, health + screen verification) and appending a deploy record. Any gate failure leaves production on the prior release. Hardens the restore-point helpers (private mktemp dir, python3 -I) after identifying a local-privesc risk in the shared-/tmp pattern. Manual --ref override and rollback stay documented. Maestro task 85cca5ad (Feature 24). Owner directive 2026-10-12.
orchestrator-agent added 2 commits 2026-10-12 07:01:38 -04:00
deploy/auto-deploy.sh runs deploy/RUNBOOK.md unattended: no-op when
origin/main is the last deployed SHA in the deploy record, wait while its
Gitea CI status is pending, refuse (exit 1) on failure or no status, then
run every runbook block (rollback SHA from the running /health, clean
checkout, make docker, Litestream restore point, boot-required
configuration, retag, restart, version and PWA verification) and append a
deploy record line. --ref <ref> deploys an explicit ref through the same
blocks, bypassing the gates. A failed deploy is recorded and never retried
by the timer.

mealquest-auto-deploy.service/.timer run it as overseer every 15 minutes
(+5 min random delay), skipped while mealquest.service is not active.

deploy/RUNBOOK.md is the PR #203 runbook (feature/launch-readiness, not yet
on dev) plus an "Automated deploys" section; AGENTS.md describes deploy/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep the restore-point helpers off shared /tmp paths (Maestro 85cca5ad)
CI / ci (push) Successful in 10m18s
CI / ci (pull_request) Successful in 10m8s
3f9558eeed
The snapshot helper runs under sudo; with /tmp on its import path any local
user could plant a module and run code as root. The Count check helpers and
check files now live in a private mktemp directory and python runs with -I.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
overseer added 1 commit 2026-10-12 07:12:39 -04:00
Resolve main explicitly and schedule auto-deploy on the calendar (Maestro 85cca5ad)
CI / ci (push) Successful in 9m44s
CI / ci (pull_request) Successful in 9m45s
0ff37e8ea5
F24-1: resolve refs/remotes/origin/main^{commit} instead of the ambiguous
origin/main, which a tag or local branch of that name would shadow.

F24-2: the timer fires on OnCalendar=*-*-* *:0/15:00 so Persistent=true
catches up a check missed while the host was down; the runbook documents
the new schedule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
review_agent requested changes 2026-10-12 07:14:51 -04:00
Dismissed
review_agent left a comment
Member

Independent Codex gpt-6-sol review: CHANGES_REQUIRED for this exact commit.

Independent Codex gpt-6-sol review: CHANGES_REQUIRED for this exact commit.
overseer added 1 commit 2026-10-12 07:23:00 -04:00
Select the full origin/main ref in the manual runbook paths (Maestro 85cca5ad)
CI / ci (push) Successful in 9m57s
CI / ci (pull_request) Successful in 9m57s
a685646288
The manual checkout and the --ref seed example now use
refs/remotes/origin/main, matching the unattended path in auto-deploy.sh,
so a tag or local branch named origin/main cannot be picked up instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
review_agent left a comment
Member

Independent Codex gpt-6-sol review: APPROVED for this exact commit.

Independent Codex gpt-6-sol review: APPROVED for this exact commit.
approver_agent merged commit 884d16638f into dev 2026-10-12 07:33:36 -04:00
Sign in to join this conversation.
No Reviewers
No labels
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Maniacs_Mansion/MealQuest#210