From bbff3324f382319db98063ff93c598edc3964ec2 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Wed, 24 Sep 2025 21:19:20 -0700 Subject: [PATCH] update install/deploy --- app/scripts/config.sh | 3 ++- app/scripts/deploy.sh | 37 +++---------------------------------- app/scripts/install.sh | 3 +++ 3 files changed, 8 insertions(+), 35 deletions(-) diff --git a/app/scripts/config.sh b/app/scripts/config.sh index 85620ab..f4a5f59 100644 --- a/app/scripts/config.sh +++ b/app/scripts/config.sh @@ -3,4 +3,5 @@ # It isn't enough to modify this yet. # You also need to manually update the nose-pluto.service file. HOST="${HOST:-chris@nose-pluto.local}" -DEST="${DEST:-~/pluto}" \ No newline at end of file +DEST="${DEST:-~/pluto}" +REPO="${REPO:-https://git.nose.space/defunkt/nose-pluto}" \ No newline at end of file diff --git a/app/scripts/deploy.sh b/app/scripts/deploy.sh index ad0b1ec..db8ed3e 100755 --- a/app/scripts/deploy.sh +++ b/app/scripts/deploy.sh @@ -1,39 +1,8 @@ #!/usr/bin/env bash ## -# deploys from your dev machine to your NOSEputer +# deploys to your NOSEputer from git -set -euo pipefail +source ./app/scripts/config.sh -source ./scripts/config.sh -SOCK="$HOME/.ssh/cm-%r@%h:%p" - -# 1) Open a master connection (prompts once) -ssh -MNf -o ControlMaster=yes -o ControlPersist=120 \ - -o ControlPath="$SOCK" "$HOST" - -# 2) rsync (reuses the connection) - -# ensure our directory exists -ssh -o ControlPath="$SOCK" "$HOST" "mkdir -p $DEST/app" - -# destructive sync for /app -rsync -az --delete \ - -e "ssh -o ControlPath=$SOCK" \ - --exclude 'node_modules/' \ - --exclude '.git/' \ - ../app/ "$HOST:$DEST/app/" - -# additive sync for root, /bin, /www -rsync -az \ - -e "ssh -o ControlPath=$SOCK" \ - --exclude 'node_modules/' \ - --exclude '.git/' \ - --exclude 'app/' \ - ../ "$HOST:$DEST/" - -# 3) remote deploy (reuses the connection) -ssh -o ControlPath="$SOCK" "$HOST" "cd $DEST && bun install --frozen-lockfile && sudo systemctl restart nose-pluto.service" - -# 4) close the master connection -ssh -O exit -o ControlPath="$SOCK" "$HOST" +ssh $HOST "cd $DEST && git pull && bun install && sudo systemctl restart nose-pluto.service" \ No newline at end of file diff --git a/app/scripts/install.sh b/app/scripts/install.sh index 476f8c6..8c19972 100755 --- a/app/scripts/install.sh +++ b/app/scripts/install.sh @@ -24,6 +24,9 @@ else echo "bun already available at $BUN_SYMLINK" fi +echo ">> Clong git repository" +git clone $REPO $DEST + echo ">> Setting CAP_NET_BIND_SERVICE on $BUN_REAL" sudo setcap 'cap_net_bind_service=+ep' "$BUN_REAL" getcap "$BUN_REAL" || true