openvibers/openvibe.tools Commits

Release notification after a deploy (roadmap WS-P task 9): deploy.sh runs `ovhost announce tools` once the gateway is healthy

OP OpenVibers committed 26 Sept 2026 · 782ed60793 · 2 files, +22 −3

OpenVibe.Host then publishes host.deploy.activated for the release the apps' /release.json reports (once per release) to OpenVibe.Events, and open tabs (openvibe-shared 1.17.0 release-watch, on the Events realtime stream) check /release.json within seconds instead of at their next poll. Best effort: skipped without an ovhost on PATH (OVHOST sets another) or with one whose --help has no `announce <service>` (said once); run through `sudo -n` when the deploy is not root (ovhost reads Host's credentials as root); `timeout 20`; a failure prints "release notification not sent (the deploy stands)". The exit code never depends on it: the health check's own failure still ends the script with curl's status, as before, and nothing is announced then. Checked by running the block against a fake ovhost (sent, failing, without announce, absent: exit 0 each). README says so.

Changes

ddiff --git a/README.md b/README.md
iindex b75b48f..477f2e3 100644
---- a/README.md
++++ b/README.md
@@@ -61,7 +61,10 @@ Public, cacheable outputs on the apex: `/` (every tool by family, planned tools
`/<family>-tools`, `/tool/<id>`, `/all-tools`, `/search?q=`, `/sitemap.xml`, `/robots.txt`,
`/llms.txt`, `/api/catalog.json`, `/terms`, `/privacy`, `/dmca`. All of it renders without JavaScript.
--Deploy with `deploy/scripts/deploy.sh` (it refreshes the copied shared package inside each app).
++Deploy with `deploy/scripts/deploy.sh` (it refreshes the copied shared package inside each app). Once the
++gateway is healthy, it runs `ovhost announce tools`. OpenVibe.Host then publishes `host.deploy.activated`
++to OpenVibe.Events, and open tabs check `/release.json` within seconds instead of at their next poll. This
++is best effort: it is skipped without an `ovhost` that has `announce`, and it never fails the deploy.
## Tool registry API (ADR-027)
ddiff --git a/deploy/scripts/deploy.sh b/deploy/scripts/deploy.sh
iindex 1211c16..becda3e 100755
---- a/deploy/scripts/deploy.sh
++++ b/deploy/scripts/deploy.sh
@@@ -1,6 +1,7 @@
#!/usr/bin/env bash
# Deploy OpenVibe.Tools on the host: pull, install dependencies in each app whose package.json
--# changed (that includes a new openvibe-shared release tag), restart the units, check health.
++# changed (that includes a new openvibe-shared release tag), restart the units, check health, then
++# announce the release to open tabs (`ovhost announce tools`; best effort, never fails the deploy).
set -euo pipefail
cd "$(dirname "$0")/../.."
BEFORE=$(git rev-parse HEAD)
@@@ -47,4 +48,19 @@ UNITS=$(systemctl list-unit-files 'openvibe-tools*' --no-legend | awk '{print $1
sudo systemctl restart $UNITS
sleep 5
for u in $UNITS; do printf '%-34s %s\n' "$u" "$(systemctl is-active "$u")"; done
--curl -fsS -o /dev/null -H 'Host: openvibe.tools' http://127.0.0.1:4001/api/health && echo "gateway healthy ($BEFORE → $AFTER)"
++curl -fsS -o /dev/null -H 'Host: openvibe.tools' http://127.0.0.1:4001/api/health && echo "gateway healthy ($BEFORE → $AFTER)" || exit $?
++# Release notification (roadmap WS-P task 9): OpenVibe.Host publishes host.deploy.activated for the release
++# the apps' /release.json reports, once per release, so open tabs check it now instead of at their next
++# poll. Best effort: skipped without an ovhost whose --help has `announce <service>`, 20 s at most, and it
++# never changes the exit code. ovhost reads Host's credentials as root (OpenVibe.Host
++# docs/release-notifications.md).
++OVHOST_BIN=$(command -v "${OVHOST:-ovhost}" 2>/dev/null || true)
++if [ -n "$OVHOST_BIN" ]; then
++ case "$("$OVHOST_BIN" --help 2>/dev/null || true)" in
++ *"announce <service>"*)
++ SUDO=""; [ "$(id -u)" -eq 0 ] || SUDO="sudo -n"
++ timeout 20 $SUDO "$OVHOST_BIN" announce tools 2>&1 || echo "release notification not sent (the deploy stands)" ;;
++ *) echo "release notification skipped: this ovhost has no announce" ;;
++ esac
++fi
++exit 0