From 65dc0061b562eda8c6dea1dc8dbfe3e2ea9b83ba Mon Sep 17 00:00:00 2001 From: jing Date: Fri, 17 Jul 2026 01:31:23 +1000 Subject: [PATCH] deploy: add --direct SSH push mode (gitea push pending credentials) Co-Authored-By: Claude Fable 5 --- scripts/deploy.sh | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 9a3dce9..a0bde7f 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -1,7 +1,12 @@ #!/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 # push to gitea + pull + remote smoke +# ./scripts/deploy.sh --direct # no gitea: push straight to hosts over SSH # ./scripts/deploy.sh --no-smoke # skip the remote smoke tests +# +# --direct needs the host repos to exist with +# git config receive.denyCurrentBranch updateInstead +# (already set up on m3ultra and m1ultra). set -euo pipefail REPO_URL="https://gitea.partly.party/monster/MIRPAMO.git" @@ -15,20 +20,31 @@ ROOT="$(cd "$(dirname "$0")/.." && pwd)" cd "$ROOT" RUN_SMOKE=1 -[[ "${1:-}" == "--no-smoke" ]] && RUN_SMOKE=0 +DIRECT=0 +for arg in "$@"; do + [[ "$arg" == "--no-smoke" ]] && RUN_SMOKE=0 + [[ "$arg" == "--direct" ]] && DIRECT=1 +done -echo "== pushing to $REPO_URL" -git push origin main +if [[ $DIRECT == 0 ]]; then + echo "== pushing to $REPO_URL" + git push origin main +fi 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 [[ $DIRECT == 1 ]]; then + echo "== $HOST: direct push" + git push "ssh://$HOST/Users/${HOST%%@*}/Documents/MIRPAMO" main + else + echo "== $HOST: pull" + ssh -o ConnectTimeout=10 "$HOST" " + if [ -d $REMOTE_PATH/.git ]; then + git -C $REMOTE_PATH pull --ff-only origin main + else + git clone $REPO_URL $REMOTE_PATH + fi" + fi if [[ $RUN_SMOKE == 1 ]]; then echo "== $HOST: smoke test" ssh "$HOST" "cd $REMOTE_PATH && ./bin/mirpamo smoke" \