From 14b8c681b00e1777967376ee9d478631a9c68ca9 Mon Sep 17 00:00:00 2001 From: Macbook Date: Sun, 14 Jun 2026 11:44:33 +0900 Subject: [PATCH] fix: regenerate desktop latest.json after deploy checkout Signed updater bundles on disk are preserved across deploy, but latest.json was reset to the git placeholder. Reconcile on nginx reload. Co-authored-by: Cursor --- scripts/reconcile-desktop-latest-json.sh | 33 +++++++++++++++++++++++ scripts/reload-frontend-desktop-static.sh | 5 ++++ 2 files changed, 38 insertions(+) create mode 100755 scripts/reconcile-desktop-latest-json.sh diff --git a/scripts/reconcile-desktop-latest-json.sh b/scripts/reconcile-desktop-latest-json.sh new file mode 100755 index 0000000..537eace --- /dev/null +++ b/scripts/reconcile-desktop-latest-json.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# signed updater bundle → latest.json (deploy/checkout 후 placeholder 복구) +set -euo pipefail + +ROOT="$(cd "$(dirname "$0")/.." && pwd)" +UPDATES_DIR="${UPDATES_DIR:-${WORK_TREE:-$ROOT}/frontend/public/desktop/updates}" +CONF="$ROOT/desktop/src-tauri/tauri.conf.json" +BASE_URL="${DESKTOP_UPDATE_BASE_URL:-https://exdev.co.kr/desktop/updates}" + +if [[ ! -d "$UPDATES_DIR" ]]; then + echo "[reconcile-latest] skip — no $UPDATES_DIR" + exit 0 +fi + +VERSION="$(node -p "require('$CONF').version" 2>/dev/null || echo '0.1.0')" +NOTES="${DESKTOP_RELEASE_NOTES:-GoldenChart Desktop $VERSION}" + +set +e +node "$ROOT/scripts/generate-desktop-latest-json.mjs" \ + --version "$VERSION" \ + --dir "$UPDATES_DIR" \ + --base-url "$BASE_URL" \ + --notes "$NOTES" +RC=$? +set -e + +if [[ "$RC" -eq 0 ]]; then + echo "[reconcile-latest] updated $UPDATES_DIR/latest.json" +elif [[ "$RC" -eq 2 ]]; then + echo "[reconcile-latest] no signed bundles — keeping existing latest.json" +else + exit "$RC" +fi diff --git a/scripts/reload-frontend-desktop-static.sh b/scripts/reload-frontend-desktop-static.sh index 8748aa6..145d32a 100755 --- a/scripts/reload-frontend-desktop-static.sh +++ b/scripts/reload-frontend-desktop-static.sh @@ -2,10 +2,15 @@ # desktop/updates static 반영 — nginx reload (볼륨 마운트 시 재빌드 불필요) set -euo pipefail +ROOT="$(cd "$(dirname "$0")/.." && pwd)" 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