Files
esh-pfi-infrastructure/playbooks/svos-releases/nh3-svos-d5e15c3-v0.0.27.yaml
T

46 lines
3.0 KiB
YAML

# nh3-svos -> SVOS v0.0.27 (d5e15c3): UI 0.0.32 (U23 v0.2 depth redo, compact inbox row, ?look= retired) + app-interface
# 0.0.9 (the three stores share state.py: state/apps/interface tightened to 0700, pins' WAL sidecars 0600; manifest changes
# only its version, so no card is expected). Kernel 0.0.27 = a version bump; NOT restarted. Prime 1005 via svos-dev
# ("deploy what you have first so it's live"), thread 01M5AH9A7QGJ018HNTSGKNGAA7. PRE-REQ: the stage playbook; origin's
# v0.0.27 == d5e15c378877.
steps:
- name: Pre-reqs present
sudo: true
shell: test -f /opt/svos/releases/d5e15c3/apps-env/bin/svos-interface && readlink /opt/svos/current && stat -c '%a %U' /var/lib/svos/state/apps/interface
changed_when: "false"
- name: Online backup of the interface stores to /var/lib/svos/backup/pre-d5e15c3
sudo: true
shell: |
set -e
d=/var/lib/svos/backup/pre-d5e15c3
runuser -u svc-svos -- install -d -m 0700 $d
runuser -u svc-svos -- python3 -c "
import sqlite3, glob, os
for src in sorted(glob.glob('/var/lib/svos/state/apps/interface/*.sqlite3')):
dst = '$d/' + os.path.basename(src)
s = sqlite3.connect('file:' + src + '?mode=ro', uri=True); t = sqlite3.connect(dst); s.backup(t); t.close(); s.close()
c = sqlite3.connect('file:' + dst + '?mode=ro', uri=True); print(os.path.basename(src), 'integrity', c.execute('pragma integrity_check').fetchone()[0])"
- name: Switch current to d5e15c3
sudo: true
shell: ln -sfn /opt/svos/releases/d5e15c3 /opt/svos/current.new && chgrp -h svc-svos /opt/svos/current.new && mv -T /opt/svos/current.new /opt/svos/current && readlink /opt/svos/current
- name: Front door inventory (UI 0.0.32 live; a83c223 becomes previous)
sudo: true
shell: /usr/local/sbin/svos-front-inventory 2>&1 | grep -E 'GENERATED|updated|root \*|path /assets' | head -4
- name: Restart ONLY svos-interface
sudo: true
shell: systemctl restart svos-interface; sleep 8; systemctl is-active svos-interface
verify:
- name: Interface on d5e15c3; its manifest (pinned without a card expected); the state dir mode
sudo: true
shell: |
pid=$(systemctl show svos-interface -p MainPID --value); grep -q /opt/svos/releases/d5e15c3 /proc/$pid/maps && echo "interface pid $pid on d5e15c3"
stat -c 'state/apps/interface %a %U' /var/lib/svos/state/apps/interface; ls -l /var/lib/svos/state/apps/interface | grep -E 'wal|shm' || true
python3 -c "
import sqlite3
c = sqlite3.connect('file:/var/lib/svos/state/svos.db?mode=ro', uri=True)
for r in c.execute(\"select slug, revision, substr(sha256,1,12), state from app_manifests where slug='app-interface' order by revision desc limit 2\"): print(r)
for r in c.execute(\"select id, kind, state, created_at from cards where slug='app-interface' and created_at > '2026-10-19T16:30' order by created_at desc limit 1\"): print(r)"
curl -s http://127.0.0.1:8400/health; echo
/usr/local/sbin/svos-front-inventory --check
changed_when: "false"