Files
jwright b27417ff02 repo: remove superseded pilot files, ASCII-clean the build and nginx configs
Drops the legacy course-1 template, the two python assemblers the node
assembler replaced, and the unversioned scene manifest left over from the
manifest-<type> split - none referenced by build.sh, the assembler or the
README, and none produce build output. The v2 pages stay: the README lists
them as parked. Also converts typographic dashes to ASCII in build.sh and the
two nginx configs, and corrects an assembler comment that still pointed at the
removed python build.
2026-08-25 21:13:45 +10:00

45 lines
2.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# Assemble dist/ - the CSP-clean static build served at learn.bztmon.com.
# The site's face is the delivery arc (index.html); scripts stay SEPARATE files so
# `script-src 'self'` holds with no 'unsafe-inline' exception. Assembly logic lives
# in pilot/assemble-arc.mjs (node - the build image carries no python).
set -euo pipefail
IFS=$'\n\t'
trap 'printf "build failed at line %s\n" "$LINENO" >&2' ERR
here="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
cd -- "$here"
for f in pilot/arc.tpl.html pilot/manifest-docker.json pilot/manifest-cluster.json \
pilot/manifest-surround.json pilot/manifest-node.json pilot/manifest-pod.json \
pilot/manifest-traffic.json pilot/manifest-orbit.json \
pilot/manifest-gitops.json pilot/manifest-supply.json \
pilot/manifest-helm.json gsap.min.js st.min.js \
assets/dist/course-VI-gitops.webp assets/dist/course-VII-supply-chain.webp \
assets/dist/course-VIII-helm-press.webp assets/dist/appendix-dependency-ledger.webp \
assets/dist/delivery-flow.svg assets/dist/docker-layers.webp \
assets/dist/course-II-cluster.webp assets/dist/course-00-surround.webp \
assets/dist/course-III-node.webp assets/dist/course-III-pod.webp \
assets/dist/course-IV-traffic.webp assets/dist/course-V-orbit.webp \
assets/dist/intro-establishing.webp \
pilot/mirror.tpl.html pilot/mirror.js pilot/index.tpl.html \
assets/mirror/20.jpg assets/mirror/21.jpg assets/mirror/22.jpg \
assets/mirror/23.jpg assets/mirror/24.jpg assets/mirror/25.jpg; do
[[ -f "$f" ]] || { printf 'missing source: %s\n' "$f" >&2; exit 1; }
done
dist="$here/dist"
rm -rf -- "$dist"
node pilot/assemble-arc.mjs "$dist"
# No inline JS may survive into ANY served HTML, or the CSP silently kills the page.
for page in "$dist"/*.html; do
if grep -oiE '<script[^>]*>' -- "$page" | grep -qivE 'src='; then
printf '%s contains an inline <script> - CSP script-src self would block it\n' "$page" >&2
exit 1
fi
done
printf 'built %s\n' "$dist"
find "$dist" -type f -printf ' %-32P %8s bytes\n' | sort