e79f028148
Co-authored-by: Cursor <cursoragent@cursor.com>
33 lines
1.1 KiB
Bash
Executable File
33 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# desktop/updates static 반영 — nginx reload (볼륨 마운트 시 재빌드 불필요)
|
|
set -euo pipefail
|
|
|
|
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
export PATH="/opt/homebrew/bin:/usr/local/bin:${PATH:-/usr/bin:/bin}"
|
|
WORK_TREE="${WORK_TREE:-/Users/aidev/apps/goldenChart}"
|
|
COMPOSE="${DOCKER_COMPOSE_FILE:-$WORK_TREE/docker-compose.yml}"
|
|
CONTAINER="${FRONTEND_CONTAINER:-gc-frontend}"
|
|
|
|
if [[ -x "$ROOT/scripts/reconcile-desktop-latest-json.sh" ]]; then
|
|
WORK_TREE="$WORK_TREE" "$ROOT/scripts/reconcile-desktop-latest-json.sh" || true
|
|
fi
|
|
|
|
if [[ ! -f "$COMPOSE" ]]; then
|
|
echo "[reload-desktop-static] skip — no compose: $COMPOSE"
|
|
exit 0
|
|
fi
|
|
|
|
if docker ps --format '{{.Names}}' | grep -qx "$CONTAINER"; then
|
|
docker exec "$CONTAINER" nginx -s reload 2>/dev/null \
|
|
&& echo "[reload-desktop-static] nginx reload OK ($CONTAINER)" \
|
|
&& exit 0
|
|
fi
|
|
|
|
if docker compose -f "$COMPOSE" ps frontend 2>/dev/null | grep -q Up; then
|
|
docker compose -f "$COMPOSE" exec -T frontend nginx -s reload \
|
|
&& echo "[reload-desktop-static] nginx reload OK (compose)" \
|
|
&& exit 0
|
|
fi
|
|
|
|
echo "[reload-desktop-static] frontend container not running — skip"
|