- 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.
43 lines
1.2 KiB
Bash
Executable File
43 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
# --- Production firmware update (Pi at onefinity.local) ---
|
|
#
|
|
# Builds a full firmware package (.tar.bz2) and PUTs it through the Pi's
|
|
# /api/firmware/update endpoint. This is the canonical OTA flow and goes
|
|
# through the bbctrl Tornado server's update handler.
|
|
#
|
|
# Defaults:
|
|
# HOST=onefinity.local
|
|
# PASSWORD=onefinity
|
|
#
|
|
# Override:
|
|
# HOST=10.1.10.55 PASSWORD=secret ./deploy.sh prod
|
|
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
cd "$SCRIPT_DIR"
|
|
|
|
HOST="${HOST:-onefinity.local}"
|
|
PASSWORD="${PASSWORD:-onefinity}"
|
|
|
|
# Require a clean working tree.
|
|
echo "🔍 Checking git state..."
|
|
if ! git diff --quiet || ! git diff --cached --quiet \
|
|
|| [[ -n "$(git ls-files --others --exclude-standard)" ]]; then
|
|
echo "❌ Refusing to deploy: working tree has uncommitted changes."
|
|
git status --short
|
|
exit 1
|
|
fi
|
|
echo "✅ Working tree is clean."
|
|
|
|
echo "🛠 Building firmware package..."
|
|
make pkg
|
|
|
|
echo "🚚 Uploading to http://${HOST}/api/firmware/update..."
|
|
make update HOST="$HOST" PASSWORD="$PASSWORD"
|
|
|
|
echo ""
|
|
echo "✅ Firmware update PUT to ${HOST}."
|
|
echo " The Pi will reboot itself after applying the update."
|
|
echo " Once it comes back, open: http://${HOST}/"
|