Files
cnx_vinyl/site/build.sh
T
grabowski 9ed51f4b22
Deploy test site / deploy (push) Successful in 51s
Factory console and customer order status: investor demo
New page docs/factory-console.html (site /demos/factory/): the factory
application of digital-factory.md on a simulated plant day, with a
switch to the customer portal of the same orders.

Factory console (sidebar: Floor, Orders, Quality, Lab, Metal, Ledger):
- floor: five presses of the launch fleet (two Newbilt Duplex systems,
  one Classic) with the mounted order, live good / rejected counters,
  stamper plays against life, cycle time and steam; KPIs for the day;
  live optical inspection stream with record keys; alerts (stops, lab
  holds, stampers near end of life, listening reviews, long gate waits);
  stations (cutting, galvanics, stamper prep, lab, packing); orders by
  stage; good records per day
- orders list with stage filters and search; order detail with stage
  track, approvals, metal genealogy and stamper metrology, press run
  telemetry, compound lot certificate, rejects by reason, audio samples,
  packing and shipping, and the order's events
- press detail with telemetry sparklines; quality (rejects by reason,
  yield per press, audio comparison); lab (compound lots with results
  against illustrative limits, one lot on hold with re-dry and retest,
  regrind batches, hoppers); metal (baths, mounted stampers, metrology,
  archive); hash-chained event log

Customer portal (four demo customers: pressing now, waiting to approve
the test pressing, in plating, delivered): progress through every step
and the three gates, copies pressed so far with the latest copies and
their record keys, approving the test pressing books the press slot
(greedy plan of the queue gives the start time and press), and a quality
report that fills in step by step: files, lacquers, metal parts with
metrology, test pressings, the compound lot's lab results, pressing and
inspection, listening checks, packing.

Simulation: 60 days warmed up at load (about 0.7 s), then 1x to 3600x.
Stages and durations from the production timeline, Newbilt cycle times,
two shifts 06:00 to 22:00, unplanned stops, stamper life 1,000 to 2,000
plays, audio sampling first-off plus about 1 in 50 (1 in 25 near end of
life), compound lots through the lab gate and release test pressing.
All orders, values and IDs are simulated; limits are illustrative.

Linked from digital-factory.md (the factory application), traceability.md
(customer-facing view), the README and the landing page.
2026-10-16 10:17:19 +07:00

63 lines
2.1 KiB
Bash

#!/usr/bin/env bash
# Assemble the cnxvinyl.lol web root in site/dist.
#
# site/public/ copied verbatim: landing page, robots.txt, and any static
# site dropped in as its own directory (site/public/<name>/)
# DEMOS below pages copied out of docs/, so docs/ stays their one source
#
# Run locally with `bash site/build.sh`, then open site/dist/index.html.
# CI (.gitea/workflows/deploy-site.yml) runs the same script and deploys
# site/dist as it is.
set -euo pipefail
cd "$(dirname "$0")/.."
out=site/dist
rm -rf "$out"
mkdir -p "$out"
cp -R site/public/. "$out/"
# "<source in the repo> <path under the web root>"
DEMOS=(
"docs/plant-operation.html demos/plant-operation/index.html"
"docs/fleet-calculator.html demos/fleet-calculator/index.html"
"docs/steam-cooling.html demos/steam-cooling/index.html"
"docs/artist-order.html demos/artist-order/index.html"
"docs/make-a-record.html demos/make-a-record/index.html"
"docs/factory-console.html demos/factory/index.html"
)
for entry in "${DEMOS[@]}"; do
read -r src dst <<<"$entry"
mkdir -p "$out/$(dirname "$dst")"
cp "$src" "$out/$dst"
done
# The deploy job reads this back from the server to confirm what is live.
git rev-parse HEAD >"$out/version.txt" 2>/dev/null || echo unknown >"$out/version.txt"
# Fail on a dead internal link: every href/src in every page that points
# inside the site must resolve to a file in dist.
dead=0
while IFS= read -r page; do
dir=$(dirname "$page")
while IFS= read -r ref; do
# shellcheck disable=SC2016 # literal ${ and {{ mark JS/template strings
case "$ref" in
'' | '#'* | http:* | https:* | mailto:* | tel:* | data:* | javascript:* | *'${'* | *'{{'*) continue ;;
esac
ref=${ref%%#*}
ref=${ref%%\?*}
case "$ref" in
/*) target="$out$ref" ;;
*) target="$dir/$ref" ;;
esac
[ -d "$target" ] && target="${target%/}/index.html"
if [ ! -f "$target" ]; then
echo "dead link in ${page#"$out"/}: $ref" >&2
dead=1
fi
done < <(grep -o -E '(href|src)="[^"]*"' "$page" | sed -E 's/^(href|src)="//; s/"$//')
done < <(find "$out" -name '*.html')
[ "$dead" -eq 0 ] || exit 1
echo "built $out: $(find "$out" -type f | wc -l | tr -d ' ') files"