eleven / messenger Public

Clone
git clone https://amadan.net/eleven/messenger

Plain git — no account needed to clone.

Download

Download this file

1#!/usr/bin/env sh
2# Step 1 of publishing the guide to elevenmessenger.com — mirrors
3# docs/planet-scale-guide/ into elevenmessenger/website's src/infrastructure/
4# (Eleventy passthrough-copies it to /infrastructure/ unmodified — see that
5# repo's .eleventy.js), commits, and pushes the website's main.
6#
7# The old GitHub Actions auto-sync (.github/workflows/sync-guide-to-website.yml)
8# is DISABLED — the project builds the site locally now — so this is the normal
9# path, not a fallback. After it pushes, run ./deploy.sh in the website checkout
10# to build and publish (step 2). It needs no token: it uses your own local git
11# credentials, exactly like pushing any other change by hand.
12#
13# ./tools/sync-guide-to-website.sh <path-to-a-local-checkout-of-website>
14#
15# # first time: clone it somewhere, then point this script at it
16# gh repo clone elevenmessenger/website /tmp/website
17# ./tools/sync-guide-to-website.sh /tmp/website
18set -eu
19
20WEBSITE_DIR="${1:?usage: $0 <path-to-a-local-checkout-of-elevenmessenger/website>}"
21REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
22
23if [ ! -d "$WEBSITE_DIR/.git" ]; then
24 echo "sync-guide-to-website: $WEBSITE_DIR is not a git checkout — clone elevenmessenger/website there first" >&2
25 exit 1
26fi
27
28echo "Updating $WEBSITE_DIR (git pull)..."
29git -C "$WEBSITE_DIR" pull --ff-only
30
31echo "Copying $REPO_ROOT/docs/planet-scale-guide/ -> $WEBSITE_DIR/src/infrastructure/..."
32rm -rf "$WEBSITE_DIR/src/infrastructure"
33mkdir -p "$WEBSITE_DIR/src/infrastructure"
34cp -r "$REPO_ROOT"/docs/planet-scale-guide/* "$WEBSITE_DIR/src/infrastructure/"
35
36cd "$WEBSITE_DIR"
37git add src/infrastructure
38if git diff --cached --quiet; then
39 echo "No changes to the guide — nothing to sync."
40 exit 0
41fi
42git commit -m "docs: sync planet-scale guide from elevenmessenger/messenger@$(git -C "$REPO_ROOT" rev-parse --short HEAD)"
43git push
44echo "Pushed website main. Now run ./deploy.sh in $WEBSITE_DIR to build + publish (no Actions)."
45