CI: Stop, copy, start on system container

This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2026-04-19 06:27:58 -03:00
parent 54e1069ce0
commit a413cbd37e

View file

@ -24,21 +24,21 @@ jobs:
run: |
cd /opt/gbo/work/botserver
cargo build -p botserver
ls -lh target/debug/botserver
- name: Deploy
run: |
BINARY="/opt/gbo/work/botserver/target/debug/botserver"
echo "Deploying from: $BINARY"
echo "1. Stop old on system..."
sudo incus exec system -- systemctl stop botserver || true
sudo incus exec system -- pkill -x botserver || true
sleep 1
# Push binary to system container
echo "2. Copy new binary..."
sudo incus file push "$BINARY" system:/opt/gbo/bin/botserver --mode=0755
echo "✅ Copied to system container"
# Restart botserver on system container
sudo incus exec system -- systemctl restart botserver
echo "✅ Restarted on system"
# Verify
echo "3. Start new on system..."
sudo incus exec system -- systemctl start botserver
sleep 2
sudo incus exec system -- pgrep -x botserver && echo "✅ Running on system!" || echo "❌ Not running"
echo "4. Verify..."
sudo incus exec system -- pgrep -x botserver && echo "✅ SUCCESS" || echo "❌ FAILED"