docs: update AGENTS.md with CI/CD systemctl deploy workflow
This commit is contained in:
parent
373bb6a6e4
commit
50a3718d82
1 changed files with 13 additions and 14 deletions
27
AGENTS.md
27
AGENTS.md
|
|
@ -928,25 +928,24 @@ Continue on gb/ workspace. Follow AGENTS.md strictly:
|
|||
"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
|
||||
ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 <PROD_HOST> \
|
||||
"sudo incus exec system -- pkill -f botserver || true"
|
||||
sleep 2
|
||||
ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 <PROD_HOST> \
|
||||
"sudo incus exec system -- bash -c 'cd /opt/gbo/bin && RUST_LOG=info nohup ./botserver --noconsole > /opt/gbo/logs/stdout.log 2>&1 &'"
|
||||
# CI deploy workflow:
|
||||
# Step 1: Check binary
|
||||
# Step 2: Backup old binary (cp /opt/gbo/bin/botserver /tmp/botserver.bak)
|
||||
# Step 3: Stop service (systemctl stop botserver)
|
||||
# Step 4: Transfer new binary (tar+gzip via SSH)
|
||||
# Step 5: Start service (systemctl start botserver)
|
||||
```
|
||||
|
||||
4. **Verify deployment**:
|
||||
```bash
|
||||
# Wait for bootstrap (~2 min)
|
||||
sleep 120
|
||||
# Check health
|
||||
ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 <PROD_HOST> \
|
||||
"sudo incus exec system -- curl -s -o /dev/null -w '%{http_code}' http://localhost:8080/health"
|
||||
# Check logs
|
||||
ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 <PROD_HOST> \
|
||||
"sudo incus exec system -- tail -30 /opt/gbo/logs/stdout.log"
|
||||
# Check service status
|
||||
ssh <PROD_HOST> "sudo incus exec system -- systemctl status botserver"
|
||||
# Monitor logs
|
||||
ssh <PROD_HOST> "sudo incus exec system -- journalctl -u botserver -f"
|
||||
# Or check stdout log
|
||||
ssh <PROD_HOST> "sudo incus exec system -- tail -30 /opt/gbo/logs/stdout.log"
|
||||
```
|
||||
|
||||
### Production Container Architecture
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue