librelad ef100acb3c refactor(hosting): website -> containers/weblibreportal; getlibreportal = downloads-only
Move the loose root-level site/ into a proper containers/weblibreportal app
(mirrors getlibreportal): the Eleventy source + nginx serving ./data via publish.sh
(npm run build -> docroot). Fix gen-data.mjs repoRoot (now ../../.. from
containers/weblibreportal/scripts) so it still finds containers/ for the catalogue.

Decouple the two hosts:
- weblibreportal  -> the website (libreportal.org)
- getlibreportal  -> downloads only (install.sh + signed release channels); its
  publish.sh no longer builds the site, and its config text updated to match.

Both are dev-only project hosting and will move to a separate repo later; for now
they live under containers/ as normal apps. ignores updated for their built
docroots; dropped the dead 'site export-ignore'.

Verified: gen-data builds the catalogue from the new location (33 apps), and
weblibreportal/publish.sh produces a docroot with index.html.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: librelad <librelad@digitalangels.vip>
2026-05-25 20:44:38 +01:00

40 lines
1.5 KiB
Bash

#!/usr/bin/env bash
#
# Assemble the getlibreportal docroot — the bootstrap installer + release channels
# — into the served data dir. (The website is a separate app: weblibreportal.)
# Run on a full repo checkout (it reads ../../dist, which is host-side).
#
# Usage: publish.sh [TARGET_DIR]
# TARGET_DIR defaults to ./data (next to this script). On a host where the app
# is installed, pass its live data dir, e.g.:
# containers/getlibreportal/publish.sh /libreportal-containers/getlibreportal/data
#
# Layout produced:
# <target>/install.sh ← bootstrap installer (repo: install.sh)
# <target>/<channel>/… ← release manifests + tarballs (repo: dist/<channel>/)
set -euo pipefail
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOT="$(cd "$HERE/../.." && pwd)" # repo root (containers/getlibreportal -> ../../)
TARGET="${1:-$HERE/data}"
echo "Assembling getlibreportal docroot -> $TARGET"
mkdir -p "$TARGET"
rm -rf "${TARGET:?}"/* "${TARGET:?}"/.??* 2>/dev/null || true
# 1. Bootstrap installer.
if [[ -f "$ROOT/install.sh" ]]; then cp -f "$ROOT/install.sh" "$TARGET/install.sh"; echo " ✓ install.sh"; fi
# 2. Release channels (from scripts/release/make_release.sh).
if [[ -d "$ROOT/dist" ]]; then
for ch in "$ROOT/dist"/*/; do
[[ -d "$ch" ]] || continue
n="$(basename "$ch")"; mkdir -p "$TARGET/$n"; cp -f "$ch"/* "$TARGET/$n/" 2>/dev/null || true
echo " ✓ channel $n"
done
else
echo " ! no dist/ — run scripts/release/make_release.sh first"
fi
echo "Done. Restart the container to serve it."