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 <cursoragent@cursor.com>
This commit is contained in:
Executable
+33
@@ -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
|
||||||
@@ -2,10 +2,15 @@
|
|||||||
# desktop/updates static 반영 — nginx reload (볼륨 마운트 시 재빌드 불필요)
|
# desktop/updates static 반영 — nginx reload (볼륨 마운트 시 재빌드 불필요)
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||||
WORK_TREE="${WORK_TREE:-/Users/aidev/apps/goldenChart}"
|
WORK_TREE="${WORK_TREE:-/Users/aidev/apps/goldenChart}"
|
||||||
COMPOSE="${DOCKER_COMPOSE_FILE:-$WORK_TREE/docker-compose.yml}"
|
COMPOSE="${DOCKER_COMPOSE_FILE:-$WORK_TREE/docker-compose.yml}"
|
||||||
CONTAINER="${FRONTEND_CONTAINER:-gc-frontend}"
|
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
|
if [[ ! -f "$COMPOSE" ]]; then
|
||||||
echo "[reload-desktop-static] skip — no compose: $COMPOSE"
|
echo "[reload-desktop-static] skip — no compose: $COMPOSE"
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
Reference in New Issue
Block a user