update-all.sh is the single source of truth for the on-host post-pull build + restart steps: render drasl/nmsr configs, sync server mods, regen the landing mod list, rebuild www/, then apply via docker compose. Two modes: - default (rolling): up -d --build, then restart ONLY services whose mounted inputs changed since a pre-run snapshot — drasl/nmsr on a config re-render, minecraft on a mod change. Minimal downtime. (Cannot detect caddy static-conf changes — use --hard for those.) - --hard: down --remove-orphans && up -d --build (full restart, MC downtime). Strict halt on any error; landing build sources nvm + pnpm (never npm) and bakes .env. fetch-authlib stays out (rarely changes) — the deploy skill runs it before update-all. Refactor the deploy skill to `pull && fetch-authlib && update-all.sh --hard` so the step list can't drift. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
3.6 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 + up). 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 - Stack: single unified
docker-compose.yml(drasl, minecraft, mc-backup, caddy, nmsr, uptime-kuma) - Auth: Drasl
- 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, ensure authlib, then
update-all.sh --hard(single SSH session, halts on any error):ssh cochi 'set -e cd /home/ubuntu/mc/ulicraft-server-v1 git pull --ff-only tooling/fetch-authlib.sh ./update-all.sh --hard'--ff-onlyrefuses to merge — if the pull is not a fast-forward, STOP and report (local changes on the host need manual resolution).fetch-authlib.shensuresruntime/authlib-injector.jarexists (gitignored; skips if already valid; NOT part of update-all since it rarely changes). Missing jar = minecraft crashloops with "Error opening zip file or JAR manifest missing". Run it beforeupdate-allso the jar is present when compose brings minecraft up.update-all.shis the single source of truth for the post-pull build + restart steps (render drasl/nmsr configs from.env, sync server mods, regen the landing mod list, rebuildwww/, then apply via docker compose). It is also runnable on its own for a lighter rolling update (no--hard= change-detected restart, no world downtime).--hardhere doesdown --remove-orphans && up -d --buildfor the deliberate full restart.render-config.shhalts on an invalidREGISTRATION_MODE(must beinviteoropen); a missing distribution jar haltssync-server-mods.sh. The landing rebuild is unconditional (the gitignoredwww/is never updated bygit pull), so no separate landing step is needed.
-
Verify.
ssh cochi 'cd /home/ubuntu/mc/ulicraft-server-v1 && docker compose ps'Confirm
caddy,drasl,minecraft,mc-backup,nmsr,uptime-kumaare 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 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,kuma_data) persist acrossdown; the world and monitors are 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.