Files
docs/publishing/docs-deploy-poll.service
inference-bot 20d384be87 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.
2026-11-12 03:23:33 +00:00

44 lines
1.8 KiB
Desktop File

# systemd unit for the docs auto-deploy poller (agent host).
#
# docs-deploy-poll.service ALWAYS ON. Polls Gitea every 60s; deploys on
# any change to main. Works with the agent
# host's current firewall (outbound only).
#
# docs-deploy-webhook.service INSTALLED, INACTIVE UNTIL THE PORT IS OPEN.
# Instant push -> deploy once the Infomaniak
# panel allows inbound TCP to the agent host
# (the Gitea webhook is already registered).
#
# Install:
# sudo cp publishing/docs-deploy-poll.service /etc/systemd/system/
# sudo systemctl daemon-reload
# sudo systemctl enable --now docs-deploy-poll
#
# poll-watcher.sh itself needs NO manual copy: the service runs the copy in
# the dedicated checkout (/home/ubuntu/.docs-publisher), which git pull keeps
# at main on every deploy, and the watcher re-execs itself when a deploy
# changed it.
#
# ONE BUILD ENVIRONMENT: the poller builds from its own dedicated checkout
# (uncommitted edits in a working clone must never block or leak into a
# deploy) but with the ONE canonical venv, DOCS_CANONICAL_DIR/.venv-docs, and
# drift-checks its publishing/ tree against the canonical checkout before
# every build. See publishing/README.md.
[Unit]
Description=Inference docs: poll Gitea main and deploy to Surfer
After=network-online.target
Wants=network-online.target
[Service]
User=ubuntu
WorkingDirectory=/home/ubuntu/.docs-publisher
Environment=DOCS_REPO_DIR=/home/ubuntu/.docs-publisher
Environment=DOCS_CANONICAL_DIR=/home/ubuntu/repos/docs
ExecStart=/bin/bash /home/ubuntu/.docs-publisher/publishing/poll-watcher.sh
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target