plan/14-deploy.md: git pull main + hard restart (compose down -> build-stack.sh --up online), drasl/online, verify + rollback. .claude/skills/deploy: skill to run it (pre-check, pull, hard restart, verify) with prod guardrails. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
3.0 KiB
3.0 KiB
name, description
| name | description |
|---|---|
| deploy | Redeploy the Ulicraft Minecraft stack to the production host `cochi` — git pull on main then a hard restart (compose down + build-stack.sh --up online). Use when the user says "deploy", "redeploy", "deploy to cochi", "push to prod", "ship it", or "restart the server" for this project. Causes brief Minecraft downtime. |
Deploy Ulicraft to cochi
Redeploy the running stack on the production host. Full reference:
plan/14-deploy.md.
Fixed parameters
- Host:
cochi(SSH alias) - Path:
/home/ubuntu/mc/ulicraft-server-v1 - Branch:
main - Run mode:
online→ compose filesdocker-compose.yml+docker-compose.static.yml - Auth: Drasl (base stack)
- Restart: hard (down → up) — players are disconnected for a few minutes
Procedure
This is an outward-facing, downtime-causing action on production. The user invoking this skill is the authorization to proceed, but:
-
Pre-check (read-only). See what would change before tearing anything down:
ssh cochi 'cd /home/ubuntu/mc/ulicraft-server-v1 && git fetch && git log --oneline HEAD..@{u}'Report the incoming commits. If the list is empty, tell the user the host is already up to date and ask whether to restart anyway (they may want a plain restart). If
git fetchfails (host unreachable, auth), STOP and report. -
Pull + hard restart (single SSH session, halts on any error):
ssh cochi 'set -e cd /home/ubuntu/mc/ulicraft-server-v1 git pull --ff-only docker compose -f docker-compose.yml -f docker-compose.static.yml down --remove-orphans tooling/build-stack.sh --up online'--ff-onlyrefuses to merge — if the pull is not a fast-forward, STOP and report (local changes on the host need manual resolution).build-stack.sh --up onlinerenders configs (needs.envcomplete:BASE_DOMAIN,HOST_LAN_IP,RCON_PASSWORD) and runscompose up -d.
-
Verify.
ssh cochi 'cd /home/ubuntu/mc/ulicraft-server-v1 && docker compose -f docker-compose.yml -f docker-compose.static.yml ps'Confirm
caddy,drasl,minecraft,mc-backupare Up. Tail the minecraft log briefly and confirm it reachesDone(server ready):ssh cochi 'cd /home/ubuntu/mc/ulicraft-server-v1 && timeout 120 docker compose -f docker-compose.yml -f docker-compose.static.yml logs -f minecraft' 2>/dev/null | grep -m1 "Done"
Guardrails
- Never
git reset --hardor discard changes oncochiwithout telling the user first — there may be host-local edits. - Volumes (
mc_data,drasl_state) persist acrossdown; the world is safe. Do NOT pass-v/--volumestodown. - If a step fails, STOP and surface the exact error + the failing command. Do not improvise recovery on production.
- Blessing Skin variant or
airgapmode changes the compose file set — if the user asks for those, followplan/14-deploy.mdinstead of the fixed commands above.