#!/bin/bash # Push current main to Gitea, then pull + smoke-test on the studio Macs. # ./scripts/deploy.sh # push + pull + remote smoke on all hosts # ./scripts/deploy.sh --no-smoke # skip the remote smoke tests set -euo pipefail REPO_URL="https://gitea.partly.party/monster/MIRPAMO.git" REMOTE_PATH="~/Documents/MIRPAMO" HOSTS=( "m3ultra@100.89.131.57" "johnking@100.91.239.7" ) ROOT="$(cd "$(dirname "$0")/.." && pwd)" cd "$ROOT" RUN_SMOKE=1 [[ "${1:-}" == "--no-smoke" ]] && RUN_SMOKE=0 echo "== pushing to $REPO_URL" git push origin main for HOST in "${HOSTS[@]}"; do echo echo "== $HOST: pull" ssh -o ConnectTimeout=10 "$HOST" " if [ -d $REMOTE_PATH/.git ]; then git -C $REMOTE_PATH pull --ff-only else git clone $REPO_URL $REMOTE_PATH fi" if [[ $RUN_SMOKE == 1 ]]; then echo "== $HOST: smoke test" ssh "$HOST" "cd $REMOTE_PATH && ./bin/mirpamo smoke" \ && echo "== $HOST: PASS" \ || { echo "== $HOST: FAIL"; exit 1; } fi done echo echo "deploy complete"