diff --git a/scripts/deploy.sh b/scripts/deploy.sh index b2b705f..1781e8b 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -7,6 +7,7 @@ set -euo pipefail HOST="chris@nose-pluto.local" DEST="~/pluto" +NOSE_DIR="~/nose" SOCK="$HOME/.ssh/cm-%r@%h:%p" # 1) Open a master connection (prompts once) @@ -20,8 +21,11 @@ rsync -az --delete \ --exclude '.git/' \ ./ "$HOST:$DEST/" -# 3) remote install (reuses the connection) +# 3) ensure $NOSE_DIR exists +ssh -o ControlPath="$SOCK" "$HOST" "mkdir -p $NOSE_DIR/{www,bin}" + +# 4) 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 +# 5) close the master connection ssh -O exit -o ControlPath="$SOCK" "$HOST"