#!/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 <