deploy to any host

This commit is contained in:
Chris Wanstrath 2026-02-25 16:06:19 -08:00
parent 3cbb25a82a
commit 8fc54bd349
7 changed files with 11 additions and 9 deletions

View File

@ -2,8 +2,10 @@
# It isn't enough to modify this yet.
# You also need to manually update the toes.service file.
HOST="${HOST:-toes@toes.local}"
URL="${URL:-http://toes.local}"
TOES_USER="${TOES_USER:-toes}"
HOST="${HOST:-toes.local}"
SSH_HOST="$TOES_USER@$HOST"
URL="${URL:-http://$HOST}"
DEST="${DEST:-~/toes}"
DATA_DIR="${DATA_DIR:-~/data}"
APPS_DIR="${APPS_DIR:-~/apps}"

View File

@ -11,7 +11,7 @@ source "$ROOT_DIR/scripts/config.sh"
git push origin main
# SSH to target: pull, build, sync apps, restart
ssh "$HOST" DEST="$DEST" APPS_DIR="$APPS_DIR" bash <<'SCRIPT'
ssh "$SSH_HOST" DEST="$DEST" APPS_DIR="$APPS_DIR" bash <<'SCRIPT'
set -e
cd "$DEST" && git checkout -- bun.lock && git pull origin main && bun install && rm -rf dist && bun run build
@ -35,5 +35,5 @@ done
sudo systemctl restart toes.service
SCRIPT
echo "=> Deployed to $HOST"
echo "=> Deployed to $SSH_HOST"
echo "=> Visit $URL"

View File

@ -9,4 +9,4 @@ ROOT_DIR="$SCRIPT_DIR/.."
source "$ROOT_DIR/scripts/config.sh"
# Run remote install on the target
ssh "$HOST" "git clone https://git.nose.space/defunkt/toes $DEST && cd $DEST && ./scripts/install.sh"
ssh "$SSH_HOST" "git clone https://git.nose.space/defunkt/toes $DEST && cd $DEST && ./scripts/install.sh"

View File

@ -6,4 +6,4 @@ ROOT_DIR="$SCRIPT_DIR/.."
source "$ROOT_DIR/scripts/config.sh"
ssh "$HOST" "journalctl -u toes -n 100"
ssh "$SSH_HOST" "journalctl -u toes -n 100"

View File

@ -6,4 +6,4 @@ ROOT_DIR="$SCRIPT_DIR/.."
source "$ROOT_DIR/scripts/config.sh"
ssh "$HOST" "sudo systemctl restart toes.service"
ssh "$SSH_HOST" "sudo systemctl restart toes.service"

View File

@ -6,4 +6,4 @@ ROOT_DIR="$SCRIPT_DIR/.."
source "$ROOT_DIR/scripts/config.sh"
ssh "$HOST" "sudo systemctl start toes.service"
ssh "$SSH_HOST" "sudo systemctl start toes.service"

View File

@ -6,4 +6,4 @@ ROOT_DIR="$SCRIPT_DIR/.."
source "$ROOT_DIR/scripts/config.sh"
ssh "$HOST" "sudo systemctl stop toes.service"
ssh "$SSH_HOST" "sudo systemctl stop toes.service"