#!/usr/bin/env bash # Deploys the committed tree (git archive HEAD) to the Docker host and # rebuilds/restarts the stack there. Run from the repo root: # scripts/deploy.sh [user@host] [remote-dir] set -euo pipefail HOST="${1:-root@192.168.5.67}" REMOTE_DIR="${2:-/opt/discordbot-cloudflarewarp}" cd "$(dirname "$0")/.." echo ">> shipping $(git rev-parse --short HEAD) to $HOST:$REMOTE_DIR" ssh "$HOST" "mkdir -p '$REMOTE_DIR'" git archive --format=tar HEAD | ssh "$HOST" "tar -x -C '$REMOTE_DIR'" ssh "$HOST" bash -s <&2 exit 1 fi docker compose build --pull docker compose up -d --remove-orphans docker compose ps REMOTE echo ">> done. follow logs with: ssh $HOST 'cd $REMOTE_DIR && docker compose logs -f'"