From da1bb3f29a3290483ab630570af2f8fabb245691 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath <2+defunkt@users.noreply.github.com> Date: Tue, 16 Sep 2025 20:40:29 -0700 Subject: [PATCH] simpler --- scripts/deploy.sh | 44 +++----------------------------------------- 1 file changed, 3 insertions(+), 41 deletions(-) diff --git a/scripts/deploy.sh b/scripts/deploy.sh index f1065b8..976c370 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -2,55 +2,17 @@ ## # deploys from your dev machine to your NOSEputer -# installs NOSE on the NOSEputer if it hasn't been installed yet set -euo pipefail HOST="chris@nose-pluto.local" DEST="~/pluto" -SOCK="$HOME/.ssh/cm-%r@%h:%p" -# 0) Open a master SSH connection (one auth prompt) -ssh -MNf -o ControlMaster=yes -o ControlPersist=180 \ - -o ControlPath="$SOCK" "$HOST" - -# 1) Sync repo (exclude junk) +# sync (skip node_modules and .git) rsync -az --delete \ - -e "ssh -o ControlPath=$SOCK" \ --exclude 'node_modules/' \ --exclude '.git/' \ - --exclude '.DS_Store' \ ./ "$HOST:$DEST/" -# 2) First-time setup if needed, then install deps and restart service -ssh -t -o ControlPath="$SOCK" "$HOST" bash -lc " - set -euo pipefail - cd $DEST - - # Ensure bun on PATH (/usr/local/bin) if user-installed in ~/.bun - if ! command -v bun >/dev/null 2>&1; then - if [ -x \"\$HOME/.bun/bin/bun\" ]; then - echo '>> Symlinking bun to /usr/local/bin' - sudo ln -sf \"\$HOME/.bun/bin/bun\" /usr/local/bin/bun - else - echo 'ERROR: bun not found (expected at ~/.bun/bin/bun)'; exit 1 - fi - fi - - # If service not present yet, run install (sets caps, installs unit, enables) - if ! systemctl list-unit-files | grep -q '^nose-pluto.service'; then - echo '>> Running first-time install for systemd unit' - bash scripts/install.sh - fi - - echo '>> bun install' - bun install --frozen-lockfile - - echo '>> Restarting service' - sudo systemctl restart nose-pluto.service -" - -# 3) Close the master connection -ssh -O exit -o ControlPath="$SOCK" "$HOST" - -echo "Deploy complete ✅" +# install deps + restart service +ssh "$HOST" 'cd ~/pluto && bun install --frozen-lockfile && sudo systemctl restart nose-pluto.service'