Integrate matrixbot into existing LXC 151 deploy hook
Removed standalone matrixbot/deploy.sh — deploy is handled by the existing webhook system. Added matrixbot/ block to deploy/lxc151-hookshot.sh: on push, if any matrixbot/ file changed, source files are synced to /opt/matrixbot and matrixbot.service is restarted automatically. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# Auto-deploy script for LXC 151 (matrix homeserver)
|
||||
# Handles: hookshot transformation functions, livekit service file (graceful)
|
||||
# Handles: hookshot transformation functions, livekit service file (graceful), matrixbot
|
||||
# Triggered by: Gitea webhook on push to main
|
||||
set -euo pipefail
|
||||
|
||||
@@ -45,6 +45,25 @@ else
|
||||
touch /run/livekit-restart-pending
|
||||
echo "Restart pending — will apply when no active calls."
|
||||
fi
|
||||
|
||||
# Matrixbot source files
|
||||
if echo "$CHANGED" | grep -q '^matrixbot/'; then
|
||||
echo "Deploying matrixbot changes..."
|
||||
BOT_DIR="/opt/matrixbot"
|
||||
BOT_FILES="bot.py callbacks.py commands.py config.py utils.py welcome.py wordle.py wordlist_answers.py wordlist_valid.py requirements.txt"
|
||||
for f in $BOT_FILES; do
|
||||
if [ -f "$REPO_DIR/matrixbot/$f" ]; then
|
||||
cp "$REPO_DIR/matrixbot/$f" "$BOT_DIR/$f"
|
||||
fi
|
||||
done
|
||||
systemctl restart matrixbot
|
||||
sleep 2
|
||||
if systemctl is-active --quiet matrixbot; then
|
||||
echo "matrixbot restarted successfully."
|
||||
else
|
||||
echo "ERROR: matrixbot failed to restart."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "=== $(date) === LXC151 deploy complete ==="
|
||||
|
||||
Reference in New Issue
Block a user