publishing: one canonical build venv; drift check; deploy-failure alerting

The poller's private venv (.docs-publisher/.venv-docs) diverged from the
canonical one twice, each time silently delaying a deploy. Consolidate:

- poll-watcher.sh builds with the ONE canonical venv
  (~/repos/docs/.venv-docs) while keeping its dedicated checkout (uncommitted
  edits in a working clone must never block or leak into a deploy).
- New drift check: publishing/ + mkdocs.yml are compared with the canonical
  checkout before every build; a mismatch fails the deploy loudly instead of
  shipping logic the canonical source cannot reproduce.
- Pre-deploy gate: build.sh --check-only verifies the pinned toolchain and
  every configured plugin (self-heals missing pins, fails loudly naming an
  unpinned plugin).
- Alerting: 3 consecutive deploy failures -> marker file + ONE Matrix message
  to the InferenceBot HQ room (hourly cap); counter resets on next success.
- The watcher re-execs itself when a deploy changed poll-watcher.sh, so the
  running loop always matches the deployed one.
- webhook receiver (dormant) repointed at the canonical venv too; unit files
  and README document the layout.
This commit is contained in:
inference-bot committed 2026-11-12 03:23:33 +00:00
1 parent 1691f79621
commit 20d384be87
5 files changed
+222 -21

No files matched your search

+7 -1
View File
@@ -31,6 +31,9 @@ import threading
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
REPO_DIR = os.environ.get("DOCS_REPO_DIR", "/home/ubuntu/repos/docs")
# ONE build environment: the canonical checkout's venv, shared by every
# trigger (poller, webhook, manual builds) since the 2026-11-12 consolidation.
BUILD_VENV = os.environ.get("DOCS_BUILD_VENV", "/home/ubuntu/repos/docs/.venv-docs")
ENV_FILE = os.environ.get("DOCS_ENV_FILE", "/home/ubuntu/.hermes/.env")
LOG_FILE = os.environ.get("DOCS_DEPLOY_LOG", "/home/ubuntu/docs-deploy.log")
LOCK_FILE = os.environ.get("DOCS_DEPLOY_LOCK", "/home/ubuntu/.docs-deploy.lock")
@@ -115,7 +118,10 @@ def deploy(commit_hint=""):
try:
steps = [
(["git", "pull", "--ff-only", "origin", "main"], 120),
(["bash", "publishing/build.sh"], 900),
# ONE build environment: build with the canonical checkout's venv,
# not a per-checkout one (the poller's private venv diverged twice
# before the 2026-11-12 consolidation).
(["bash", "publishing/build.sh", BUILD_VENV], 900),
(["bash", "publishing/deploy.sh"], 600),
]
for cmd, timeout in steps: