docs: update AGENTS.md with CI/CD systemctl deploy workflow

This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2026-04-03 21:40:52 -03:00
parent 373bb6a6e4
commit 50a3718d82

View file

@ -928,25 +928,24 @@ Continue on gb/ workspace. Follow AGENTS.md strictly:
"sudo incus exec system -- stat -c '%y' /opt/gbo/bin/botserver" "sudo incus exec system -- stat -c '%y' /opt/gbo/bin/botserver"
``` ```
3. **Restart in prod**after binary updates: 3. **Restart in prod**CI/CD handles this automatically:
```bash ```bash
ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 <PROD_HOST> \ # CI deploy workflow:
"sudo incus exec system -- pkill -f botserver || true" # Step 1: Check binary
sleep 2 # Step 2: Backup old binary (cp /opt/gbo/bin/botserver /tmp/botserver.bak)
ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 <PROD_HOST> \ # Step 3: Stop service (systemctl stop botserver)
"sudo incus exec system -- bash -c 'cd /opt/gbo/bin && RUST_LOG=info nohup ./botserver --noconsole > /opt/gbo/logs/stdout.log 2>&1 &'" # Step 4: Transfer new binary (tar+gzip via SSH)
# Step 5: Start service (systemctl start botserver)
``` ```
4. **Verify deployment**: 4. **Verify deployment**:
```bash ```bash
# Wait for bootstrap (~2 min) # Check service status
sleep 120 ssh <PROD_HOST> "sudo incus exec system -- systemctl status botserver"
# Check health # Monitor logs
ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 <PROD_HOST> \ ssh <PROD_HOST> "sudo incus exec system -- journalctl -u botserver -f"
"sudo incus exec system -- curl -s -o /dev/null -w '%{http_code}' http://localhost:8080/health" # Or check stdout log
# Check logs ssh <PROD_HOST> "sudo incus exec system -- tail -30 /opt/gbo/logs/stdout.log"
ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 <PROD_HOST> \
"sudo incus exec system -- tail -30 /opt/gbo/logs/stdout.log"
``` ```
### Production Container Architecture ### Production Container Architecture