deploy: add macOS-friendly deploy scripts (local / hardware / prod)
- deploy.sh dispatcher + thin shims (deploy-local.sh / -hardware.sh / -prod.sh). - scripts/deploy/local.sh: build UI bundle and serve via tmux session on :8770 for offline iteration. - scripts/deploy/hardware.sh: rsync-based push to a Pi over SSH and restart bbctrl.service. - scripts/deploy/prod.sh: bundle release tarball. - scripts/deploy/patch_font_mime.py: hot-patches Chromium 72's broken WOFF2 mime handling on the kiosk Pi.
This commit is contained in:
52
deploy.sh
Executable file
52
deploy.sh
Executable file
@@ -0,0 +1,52 @@
|
||||
#!/bin/bash
|
||||
# Onefinity firmware deploy script.
|
||||
#
|
||||
# ./deploy.sh local — build & static-serve the UI on macOS
|
||||
# (chrome only; no controller, shows
|
||||
# DISCONNECTED overlay)
|
||||
# ./deploy.sh hardware — fast iteration: rsync build/http/
|
||||
# contents to the running Pi at
|
||||
# onefinity.local, then restart bbctrl
|
||||
# ./deploy.sh prod — full firmware update via the Pi's
|
||||
# /api/firmware/update endpoint
|
||||
# (equivalent to `make update`)
|
||||
#
|
||||
# Notes:
|
||||
# * On macOS we cannot run the Python `bbctrl` controller directly
|
||||
# because it imports the ARM-only camotics gplan.so. For full UI
|
||||
# testing with live data, deploy to the Pi (hardware or prod).
|
||||
# * `prod` requires a clean working tree.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
cd "$SCRIPT_DIR"
|
||||
|
||||
CMD="${1:-}"
|
||||
|
||||
case "$CMD" in
|
||||
local) exec "$SCRIPT_DIR/scripts/deploy/local.sh" "$@" ;;
|
||||
hardware) exec "$SCRIPT_DIR/scripts/deploy/hardware.sh" "$@" ;;
|
||||
prod) exec "$SCRIPT_DIR/scripts/deploy/prod.sh" "$@" ;;
|
||||
*)
|
||||
cat <<USAGE
|
||||
usage: $0 {local | hardware | prod}
|
||||
|
||||
local Build the UI and static-serve build/http/ in a tmux session
|
||||
on macOS. Useful for iterating on the V09 chrome and routing.
|
||||
URL: http://localhost:8770/
|
||||
tmux: tmux attach -t onefin-local
|
||||
|
||||
hardware Fast iteration on the actual controller: rsync the freshly
|
||||
built build/http/ tree onto onefinity.local, then restart
|
||||
the bbctrl service. Requires SSH access as bbmc@onefinity.local.
|
||||
Defaults: HOST=onefinity.local PASSWORD=onefinity
|
||||
|
||||
prod Build a full firmware package (.tar.bz2) and PUT it through
|
||||
/api/firmware/update on the Pi. Equivalent to:
|
||||
make update HOST=onefinity.local PASSWORD=onefinity
|
||||
Requires a clean working tree.
|
||||
USAGE
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user