mirror of
https://github.com/kuhyx/diet-guard.git
synced 2026-11-21 20:02:18 +01:00
deploy.sh: restart the Claude worker
Some checks are pending
dependency freshness / dependencies on newest stable (push) Waiting to run
file-length / file length <= 250 lines (push) Waiting to run
md-naming / markdown naming convention (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (mypy, mypy, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (pylint, pylint, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (rest, , mypy,pylint) (push) Waiting to run
Tests / test (push) Waiting to run
release-apk / release (APK) (push) Waiting to run
repo-contract / repo contract (push) Waiting to run
Some checks are pending
dependency freshness / dependencies on newest stable (push) Waiting to run
file-length / file length <= 250 lines (push) Waiting to run
md-naming / markdown naming convention (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (mypy, mypy, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (pylint, pylint, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (rest, , mypy,pylint) (push) Waiting to run
Tests / test (push) Waiting to run
release-apk / release (APK) (push) Waiting to run
repo-contract / repo contract (push) Waiting to run
The worker is long-running, so a pip install alone left it on the old rtdb-relay. Restart it when enabled and check it stays up. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
51a31579c8
commit
9a0cc89941
@ -2,7 +2,7 @@ name: diet_guard_app
|
||||
description: "Companion phone app for diet_guard: log meals on the go."
|
||||
publish_to: 'none'
|
||||
|
||||
version: 1.0.182+1
|
||||
version: 1.0.183+1
|
||||
|
||||
environment:
|
||||
sdk: ^3.12.2
|
||||
|
||||
@ -6,6 +6,8 @@
|
||||
# 2. Reinstall it into system Python's user site: diet-guard-gate.service
|
||||
# runs /usr/bin/python, not a venv (CLAUDE.md, the 2026-06-19 outage).
|
||||
# 3. Rebuild and reinstall the desktop app package (app/install_arch.sh).
|
||||
# 4. Restart the long-running Claude worker so it loads the new code (the
|
||||
# gate is a oneshot timer and picks it up on its next tick).
|
||||
#
|
||||
# The phone APK ships through CI (release-apk.yml) and phone_deploy.sh.
|
||||
# Idempotent; exits non-zero unless every health check passes.
|
||||
@ -24,14 +26,24 @@ fail() {
|
||||
git -C "$REPO" pull --ff-only
|
||||
"$PY" -m pip install --user --break-system-packages -q -e "$REPO"
|
||||
(cd "$REPO/app" && bash install_arch.sh)
|
||||
readonly WORKER=diet-guard-claude.service
|
||||
worker_on=false
|
||||
if systemctl --user is-enabled --quiet "$WORKER"; then
|
||||
worker_on=true
|
||||
systemctl --user restart "$WORKER"
|
||||
fi
|
||||
|
||||
# Health: the gate's own interpreter imports the code the timer will run...
|
||||
"$PY" -c 'import diet_guard._cli, diet_guard._errors, diet_guard._gatelock' \
|
||||
|| fail "system python cannot import the gate"
|
||||
systemctl --user is-enabled --quiet diet-guard-gate.timer \
|
||||
|| fail "diet-guard-gate.timer is not enabled"
|
||||
if "$worker_on"; then
|
||||
sleep 3 # a worker that crashes on import dies within a second or two
|
||||
systemctl --user is-active --quiet "$WORKER" || fail "$WORKER did not stay up"
|
||||
fi
|
||||
# ...and the desktop package is the version this checkout builds.
|
||||
want="$(sed -n 's/^version:[[:space:]]*\([^+]*\).*/\1/p' "$REPO/app/pubspec.yaml")"
|
||||
have="$(pacman -Q diet-guard-app | awk '{print $2}')"
|
||||
[[ "$have" == "$want-1" ]] || fail "desktop app is $have, want $want-1"
|
||||
echo "deploy: ok (gate imports, timer enabled, desktop app $have)"
|
||||
echo "deploy: ok (gate imports, timer enabled, worker restarted=$worker_on, desktop app $have)"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user