Files
Void-Homelab/deploy/push-workers.sh
root 941df0d0d2 fix(deploy): point deploy targets at CT 311 new IP .216
Post-outage recovery: a rogue OpenWrt device seized 192.168.1.13 after the
power-cut reboot, ARP-poisoning the LAN so CT 311 was unreachable despite being
healthy. Renumbered CT 311 .13 -> .216 (out of the conflict-prone low range,
next to the DB at .215). Update push.sh + push-workers.sh defaults to
root@192.168.1.216; push.sh no longer defaults to the void2-app hostname (that
resolves to the Cloudflare tunnel and can't carry SSH).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 17:49:08 +10:00

36 lines
861 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# Push Python void-workers source to CT 311 and restart the service.
# Run from /project/src/void-v2.
TARGET=${TARGET:-root@192.168.1.216}
REMOTE_DIR=${REMOTE_DIR:-/opt/void-workers}
rsync -avz --delete \
--exclude .venv \
--exclude venv \
--exclude __pycache__ \
--exclude '*.egg-info' \
--exclude tests \
--exclude .env \
--exclude .gitignore \
--exclude .pytest_cache \
workers/ "$TARGET:$REMOTE_DIR/"
ssh "$TARGET" "
# rsync runs as root → files land root-owned. Workers run as voidworkers.
chown -R voidworkers: $REMOTE_DIR
su voidworkers -c '
cd $REMOTE_DIR
if [ ! -d venv ]; then
python3 -m venv venv
fi
. venv/bin/activate
pip install --quiet --upgrade pip
pip install --quiet -e \".[all]\"
'
systemctl restart void-workers
"
echo "Workers deployed."