fun
This commit is contained in:
parent
da1bb3f29a
commit
d06f9f62df
|
|
@ -7,12 +7,21 @@ set -euo pipefail
|
|||
|
||||
HOST="chris@nose-pluto.local"
|
||||
DEST="~/pluto"
|
||||
SOCK="$HOME/.ssh/cm-%r@%h:%p"
|
||||
|
||||
# sync (skip node_modules and .git)
|
||||
# 1) Open a master connection (prompts once)
|
||||
ssh -MNf -o ControlMaster=yes -o ControlPersist=120 \
|
||||
-o ControlPath="$SOCK" "$HOST"
|
||||
|
||||
# 2) rsync (reuses the connection)
|
||||
rsync -az --delete \
|
||||
-e "ssh -o ControlPath=$SOCK" \
|
||||
--exclude 'node_modules/' \
|
||||
--exclude '.git/' \
|
||||
./ "$HOST:$DEST/"
|
||||
|
||||
# install deps + restart service
|
||||
ssh "$HOST" 'cd ~/pluto && bun install --frozen-lockfile && sudo systemctl restart nose-pluto.service'
|
||||
# 3) remote install (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"
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user