Deploy
Admin guide · Deploy runbook
🟢 Supported · ⚠️ CI/CD only · ALM on port 4747, never 3000
| When to use | Before you start | Steps | Verify | Roll back |
|---|---|---|---|---|
| Ship a code change | CI runner online, commit pushed to both remotes | Push, wait for CI, restart | Health 200, binary timestamp new | Redeploy previous commit via CI |
When to use
You have a merged code change and need it running on the server. Never compile directly for production, copy a binary by hand, or SSH into the bot container to drop a binary in place: CI builds, transfers and restarts.
Before you start
- Push to ALM and the mirror; the ALM HTTP port is 4747, not 3000.
- The CI runner is the
alm-cicontainer. A runner that registered on port 3000 will never pick up jobs. - The CI deploy path builds at
/opt/gbo/data/botserver/target/debug/botserver, then transfers a tar+gzip over SSH to/opt/gbo/bin/botserveron the bot container and restarts it. - Take a snapshot of the service container first (see Operate).
- Internal hosts are referenced by
<PROD_HOST>/<ALM_HOST>and credentials by environment variables, never as literals in this page or a log.
Steps
cd botserver
git push alm main
git push origin main
cd ..
git add botserver
git commit -m "Update botserver: <description>"
git push alm main
git push origin main
Wait for the CI run to finish programmatically:
ALM_URL="http://<ALM_HOST>:4747"
REPO="GeneralBots/BotServer"
MAX_WAIT=600; ELAPSED=0
while [ $ELAPSED -lt $MAX_WAIT ]; do
STATUS=$(curl -sf "$ALM_URL/api/v1/repos/$REPO/actions/runs?per_page=1" | python3 -c "import sys,json; runs=json.load(sys.stdin); print(runs[0]['status'] if runs else 'unknown')")
if [ "$STATUS" = "completed" ] || [ "$STATUS" = "failure" ] || [ "$STATUS" = "cancelled" ]; then
echo "CI finished with status: $STATUS"; break
fi
echo "CI status: $STATUS (waiting ${ELAPSED}s...)"; sleep 15; ELAPSED=$((ELAPSED + 15))
done
Restart only after a completed build (repository AGENTS.md):
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 &'"
For routine service management inside a container use
sudo incus exec <container> -- systemctl restart <service>; run the botserver
through systemd inside the container. The manual transfer path is reserved for
a genuinely offline CI runner and is documented in the repository AGENTS.md.
Verify
| Check | Command | Pass condition |
|---|---|---|
| CI result | loop above | completed, not failure or cancelled |
| Process | sudo incus exec system -- pgrep -a botserver |
one live process |
| Health | sudo incus exec system -- curl -s -o /dev/null -w '%{http_code}' http://localhost:8080/health |
200 after ~2 min bootstrap |
| Log | sudo incus exec system -- tail -30 /opt/gbo/logs/stdout.log |
Bootstrap process completed!, no ERROR |
| Binary | sudo incus exec system -- stat -c '%y' /opt/gbo/bin/botserver |
timestamp updated |
A sealed Vault blocks bootstrap: botserver retries while the old process keeps working from cached credentials. Unseal before repeating the check.
Roll back
🔴 Revert the commit, push both remotes and let CI redeploy the previous binary; do not hand-copy a binary. If the change included configuration, restore it with the configure runbook. If the container itself is unhealthy, copy the pre-deploy snapshot into a new instance and re-run the verification table.
See also the deploy and rollback runbook, production readiness, CLI reference, CI/CD integration and container deployment.