project-diagramming-archify: add publish-maps.sh — rsync docs/ to maps site behind Caddy on .35
- publish-maps.sh: incremental/atomic rsync of <project>/docs to maps.lab.audasmedia.com.au/<project>/docs (excludes visual-check sidecars) - SKILL.md: document publish step after deliver + site URL - maps.lab.audasmedia.com.au served by Caddy on .35 (file_server browse, no auth)
This commit is contained in:
@@ -47,6 +47,21 @@ Commands (from the vendored skill's fast authoring path):
|
||||
|
||||
Create `<project>/docs/` (+ `docs/archify/`) if missing. Never write artifacts outside the project directory.
|
||||
|
||||
## Publish to the central maps site (optional but recommended)
|
||||
|
||||
After a successful `deliver`, offer to **publish** the project's `docs/` to the LAN maps site:
|
||||
|
||||
```bash
|
||||
~/.agents/skills/project-diagramming-archify/publish-maps.sh [<project-dir>]
|
||||
```
|
||||
|
||||
- Uploads `docs/` to Caddy on `.35` → **`https://maps.lab.audasmedia.com.au/<project>/docs/`** (site index at `https://maps.lab.audasmedia.com.au/` — Caddy `file_server browse`, no auth, read-only static hosting).
|
||||
- **Incremental + atomic** (rsync -az): only changed blocks transfer; no half-written files on failure.
|
||||
- Excludes `*.visual-check.*` sidecars automatically (keeps the browse index clean).
|
||||
- Works from any machine with ssh key access to `.35` (all three pi machines have it).
|
||||
- `publish-maps.sh --list` shows what's already published.
|
||||
- Wait for `visual-check` to pass first; `publish-maps.sh` does NOT re-run it.
|
||||
|
||||
## Authoring rules (subset of the vendored skill — read SKILL.md for full invariants)
|
||||
|
||||
- Omit `meta.visual_preset`, `meta.subtitle`, `meta.legend`, `meta.engineering_profile` by default.
|
||||
|
||||
51
skills/project-diagramming-archify/publish-maps.sh
Executable file
51
skills/project-diagramming-archify/publish-maps.sh
Executable file
@@ -0,0 +1,51 @@
|
||||
#!/usr/bin/env bash
|
||||
# publish-maps.sh — publish a project's docs/ (Archify maps, Mermaid sources,
|
||||
# diagrams) to the central maps site behind Caddy on .35.
|
||||
#
|
||||
# URL: https://maps.lab.audasmedia.com.au/<project>/docs/ (file_server browse)
|
||||
# Host: sam@192.168.20.35:/Docker/Containers/caddy/maps/
|
||||
#
|
||||
# Usage:
|
||||
# publish-maps.sh [<project-dir>] # default: current directory
|
||||
# publish-maps.sh --list # list what's already published
|
||||
#
|
||||
# Incremental + atomic (rsync -az): only changed blocks transfer; files are
|
||||
# renamed into place so a failure mid-run can't leave a half-written map.
|
||||
set -euo pipefail
|
||||
|
||||
REMOTE="sam@192.168.20.35"
|
||||
DEST_ROOT="/Docker/Containers/caddy/maps"
|
||||
SSH_E="-e ssh -o BatchMode=yes -o ConnectTimeout=8"
|
||||
|
||||
if [[ "${1:-}" == "--list" ]]; then
|
||||
ssh -o BatchMode=yes -o ConnectTimeout=8 "$REMOTE" "ls -1 $DEST_ROOT" \
|
||||
|| { echo "cannot reach $REMOTE" >&2; exit 1; }
|
||||
exit 0
|
||||
fi
|
||||
|
||||
PROJ="${1:-$(pwd)}"
|
||||
PROJ="$(cd "$PROJ" && pwd)"
|
||||
NAME="$(basename "$PROJ")"
|
||||
DOCS="$PROJ/docs"
|
||||
|
||||
if [[ ! -d "$DOCS" ]]; then
|
||||
echo "no docs/ found in $PROJ — nothing to publish" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DEST="$DEST_ROOT/$NAME/docs"
|
||||
echo "→ publishing $PROJ/docs → $REMOTE:$DEST"
|
||||
|
||||
# Create the project's parent dir on the remote (rsync won't make nested parents)
|
||||
ssh -o BatchMode=yes -o ConnectTimeout=8 "$REMOTE" "mkdir -p $DEST" \
|
||||
|| { echo "cannot create $DEST on $REMOTE" >&2; exit 1; }
|
||||
|
||||
# -a archive, -z compress, --exclude Archify visual-check sidecars (screenshots
|
||||
# + receipts live next to the map; keeps the browse index clean)
|
||||
rsync -az \
|
||||
--exclude '*.visual-check.*' \
|
||||
"$SSH_E" \
|
||||
"$DOCS/" "$REMOTE:$DEST/"
|
||||
|
||||
echo "✓ published: https://maps.lab.audasmedia.com.au/$NAME/docs/"
|
||||
echo " (site index: https://maps.lab.audasmedia.com.au/)"
|
||||
Reference in New Issue
Block a user