From 399eaab17e118210f15748ac03ca9c0dc81500a9 Mon Sep 17 00:00:00 2001 From: Michael Czechowski Date: Mon, 4 May 2026 16:19:26 +0200 Subject: [PATCH] docs(deploy): add netcup deploy runbook Derived from netcup canonical DEPLOY-TEMPLATE.md. Same 9 sections across all stacks (target, env, first-time, update, smoke, troubleshooting, rollback, stack-specific notes, issue tracking). README links to DEPLOY.md. --- DEPLOY.md | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 2 ++ 2 files changed, 77 insertions(+) create mode 100644 DEPLOY.md diff --git a/DEPLOY.md b/DEPLOY.md new file mode 100644 index 0000000..c033615 --- /dev/null +++ b/DEPLOY.md @@ -0,0 +1,75 @@ +# Deploy runbook — cc (code-crispies) + +Derived from [`netcup/DEPLOY-TEMPLATE.md`](https://git.librete.ch/libretech/netcup/src/branch/main/DEPLOY-TEMPLATE.md). +Section ordering and headings stable across stacks. + +## 1. Target + +| Field | Value | +|-------|-------| +| Vhost | `cc.cloud.librete.ch` | +| Server path | `/srv/cc/` | +| Repo | `git.librete.ch/public/code-crispies` | +| Image source | build from source on remote (Dockerfile) — image tag `${CC_IMAGE:-cc:local}` | +| Cert | edge caddy via INWX DNS-01 | +| Edge net container name | `cc` (matches `caddy/Caddyfile` reverse_proxy target on `:80`) | + +## 2. Required env / secrets + +`/srv/cc/.env` (gitignored, mode 0600): only set if non-default behavior is needed (e.g. `CC_IMAGE` to use a registry-published tag). + +## 3. First-time deploy + +```sh +ssh netcup 'docker network ls | grep -q edge || docker network create edge' +ssh netcup 'mkdir -p /srv && cd /srv && git clone ssh://tengo@git.librete.ch:41240/public/code-crispies.git cc' +ssh netcup 'cd /srv/cc && docker compose up -d --build' +``` + +## 4. Update deploy + +```sh +n-deploy cc +# = git push → ssh 'cd /srv/cc && git pull --ff-only && docker compose pull && docker compose up -d' +``` + +For source rebuilds: + +```sh +ssh netcup 'cd /srv/cc && git pull --ff-only && docker compose up -d --build' +``` + +## 5. Smoke / health + +```sh +n-ping cc.cloud.librete.ch +n-cert cc.cloud.librete.ch +n-svcs cc +``` + +UI smoke: lessons load, interactive Tailwind/CSS sandbox renders. + +## 6. Logs + troubleshooting + +| Symptom | First check | +|---------|-------------| +| 502 from edge | `cc` not up or off `edge` net | +| Stale assets | rebuild image (`up -d --build`); browser cache | + +## 7. Rollback + +```sh +ssh netcup 'cd /srv/cc && git log --oneline -n 5' +ssh netcup 'cd /srv/cc && git reset --hard && docker compose up -d --build' +``` + +## 8. Stack-specific notes + +- Stateless: no persistent volumes worth preserving (content is shipped in the image). +- Pure static / Node-built site; no database. + +## 9. Issue tracking + +- Deploy issues: `git.librete.ch/public/code-crispies/issues` +- Cross-stack: `libretech/netcup` +- After every deploy: append to `netcup/deployments.md`. diff --git a/README.md b/README.md index 4daf750..23da019 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ An interactive platform for learning HTML, CSS, and Tailwind CSS through practical challenges. +> **Deploy / operate on netcup:** see [DEPLOY.md](DEPLOY.md) (canonical netcup runbook). + ## 📚 Overview Code Crispies is a web-based learning platform designed to help users master HTML, CSS, and Tailwind CSS through hands-on exercises. The application presents a series of progressive challenges organized into themed modules, allowing learners to build their skills step by step while receiving immediate feedback.