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>
26 lines
968 B
Bash
26 lines
968 B
Bash
#!/usr/bin/env bash
|
|
#
|
|
# Build the LibrePortal website (Eleventy) and publish it into the served docroot.
|
|
# Run on a full repo checkout (it reads ../*/*.config to build the app catalogue).
|
|
#
|
|
# 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/weblibreportal/publish.sh /libreportal-containers/weblibreportal/data
|
|
set -euo pipefail
|
|
|
|
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
TARGET="${1:-$HERE/data}"
|
|
|
|
command -v npm >/dev/null 2>&1 || { echo "publish.sh: npm is required to build the website" >&2; exit 1; }
|
|
|
|
echo "Building the website ..."
|
|
( cd "$HERE" && npm install --silent && npm run build ) # → ./dist (runs gen-data + eleventy)
|
|
|
|
echo "Publishing -> $TARGET"
|
|
mkdir -p "$TARGET"
|
|
rm -rf "${TARGET:?}"/* "${TARGET:?}"/.??* 2>/dev/null || true
|
|
cp -a "$HERE/dist/." "$TARGET/"
|
|
|
|
echo "Done. Restart the container to serve it."
|