Files
xhs_crawler/quick_hotpatch.sh
T

18 lines
525 B
Bash

#!/usr/bin/env bash
set -euo pipefail
# Fast hot-patch without rebuild: copy host app/ into container then restart.
# Usage: ./quick_hotpatch.sh
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$ROOT_DIR"
echo "[hotpatch] Copying app/ into xhs-web..."
docker cp ./app/server.py xhs-web:/app/app/server.py
docker cp ./app/static/index.html xhs-web:/app/app/static/index.html
echo "[hotpatch] Restarting xhs-web..."
docker restart xhs-web >/dev/null
echo "[hotpatch] Tail logs..."
docker logs xhs-web --tail=50