1a9dc1d676
- discord.js 14 bot with /ping and /warp, periodic WARP egress-IP logging - Dockerfile: node:22-bookworm-slim + cloudflare-warp 2026.7.1377.0 (.deb) - entrypoint boots dbus/warp-svc, registers, connects, verifies warp=on - docker-compose with NET_ADMIN, /dev/net/tun, sysctls, healthcheck - deploy script, README, CHANGELOG, lockfile generated inside Docker Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
29 lines
873 B
Bash
29 lines
873 B
Bash
#!/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 <<REMOTE
|
|
set -euo pipefail
|
|
cd '$REMOTE_DIR'
|
|
if [ ! -f .env ]; then
|
|
echo "!! $REMOTE_DIR/.env is missing on the host. Create it from .env.example first." >&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'"
|