버전문제 수정

This commit is contained in:
Macbook
2026-06-14 23:49:16 +09:00
parent 8b982d7272
commit 198ebbb3d7
5 changed files with 64 additions and 6 deletions
+1
View File
@@ -1,5 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# git push 전 desktop semver patch bump → tauri.conf.json + desktop/package.json # git push 전 desktop semver patch bump → tauri.conf.json + desktop/package.json
# Desktop 번들: frontend + packages/shared, 런타임: backend API
# (로컬 dist-desktop/build-info 는 무시 — stale 버전 방지) # (로컬 dist-desktop/build-info 는 무시 — stale 버전 방지)
set -euo pipefail set -euo pipefail
+41
View File
@@ -0,0 +1,41 @@
#!/usr/bin/env bash
# Desktop 앱 번들·런타임에 영향을 주는 경로 (frontend 공유 + backend API)
#
# - desktop/ Tauri 셸
# - frontend/ @frontend 번들 (desktop 과 동일 UI)
# - backend/ API·비즈니스 로직 (desktop 이 exdev API 사용)
# - packages/shared/ frontend·desktop 공유 모듈
set -euo pipefail
# grep -E extended regex (한 줄 = OR, ^ = 경로 시작)
DESKTOP_VERSION_AFFECTED_REGEX='^(desktop/|frontend/|backend/|packages/shared/|scripts/(build-desktop|jenkins-desktop|publish-desktop|bump-desktop|push-with-desktop))'
desktop_version_diff_affects_app() {
local range="${1:-}"
[[ -n "$range" ]] || return 1
git diff --name-only "$range" 2>/dev/null | grep -Eq "$DESKTOP_VERSION_AFFECTED_REGEX"
}
desktop_version_list_affected_in_range() {
local range="${1:-}"
[[ -n "$range" ]] || return 0
git diff --name-only "$range" 2>/dev/null | grep -E "$DESKTOP_VERSION_AFFECTED_REGEX" || true
}
if [[ "${BASH_SOURCE[0]:-}" == "${0:-}" ]]; then
case "${1:-}" in
check)
desktop_version_diff_affects_app "${2:-HEAD~1..HEAD}" && exit 0 || exit 1
;;
list)
desktop_version_list_affected_in_range "${2:-HEAD~1..HEAD}"
;;
regex)
echo "$DESKTOP_VERSION_AFFECTED_REGEX"
;;
*)
echo "Usage: $0 check|list|regex [git-range]" >&2
exit 1
;;
esac
fi
+17 -5
View File
@@ -1,11 +1,12 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Desktop/Frontend 변경 push 시 semver bump 필수 (plain git push 차단) # frontend/backend/desktop/shared 변경 push 시 semver bump 필수
set -euo pipefail set -euo pipefail
ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)" ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
cd "$ROOT" cd "$ROOT"
DESKTOP_PATHS='^(desktop/|frontend/|scripts/(build-desktop|jenkins-desktop|publish-desktop|bump-desktop))' # shellcheck disable=SC1091
source "$ROOT/scripts/desktop-version-scope.sh"
read_local_version() { read_local_version() {
"$ROOT/scripts/read-desktop-version.sh" 2>/dev/null || echo "0.0.0" "$ROOT/scripts/read-desktop-version.sh" 2>/dev/null || echo "0.0.0"
@@ -36,7 +37,7 @@ while read -r _local_ref local_sha _remote_ref remote_sha; do
range="${remote_sha}..${local_sha}" range="${remote_sha}..${local_sha}"
fi fi
if ! git diff --name-only "$range" 2>/dev/null | grep -Eq "$DESKTOP_PATHS"; then if ! desktop_version_diff_affects_app "$range"; then
continue continue
fi fi
@@ -49,10 +50,21 @@ while read -r _local_ref local_sha _remote_ref remote_sha; do
echo "" echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo " Desktop/Frontend 변경 push — semver bump 가 필요합니다." echo " Desktop 앱 영향 변경(frontend/backend/desktop/shared)"
echo " push — semver bump 가 필요합니다."
echo " 로컬 v${local_ver} ≤ 원격 v${remote_ver}" echo " 로컬 v${local_ver} ≤ 원격 v${remote_ver}"
echo "" echo ""
echo " 다음 명령으로 bump + push + Jenkins 빌드:" affected="$(desktop_version_list_affected_in_range "$range" | head -5 | sed 's/^/ /')"
if [[ -n "$affected" ]]; then
echo " 변경 예:"
echo "$affected"
count="$(desktop_version_list_affected_in_range "$range" | wc -l | tr -d ' ')"
if [[ "$count" -gt 5 ]]; then
echo " ... 외 $((count - 5))개 파일"
fi
echo ""
fi
echo " bump + push + Jenkins Desktop 빌드:"
echo " ./scripts/push-with-desktop-version.sh" echo " ./scripts/push-with-desktop-version.sh"
echo "" echo ""
echo " bump 만:" echo " bump 만:"
+2 -1
View File
@@ -14,4 +14,5 @@ fi
cp "$HOOK_SRC" "$GIT_HOOK" cp "$HOOK_SRC" "$GIT_HOOK"
chmod +x "$GIT_HOOK" chmod +x "$GIT_HOOK"
echo "[install-desktop-git-hooks] pre-push hook 설치됨" echo "[install-desktop-git-hooks] pre-push hook 설치됨"
echo " Desktop/Frontend 변경 시 ./scripts/push-with-desktop-version.sh 사용" echo " frontend/backend/desktop/shared 변경 push 시 bump 필수"
echo " → ./scripts/push-with-desktop-version.sh"
+3
View File
@@ -1,6 +1,9 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# git push + desktop semver 명시 bump (커밋 포함) # git push + desktop semver 명시 bump (커밋 포함)
# #
# Desktop 은 frontend 소스를 번들하고 backend API 를 사용하므로
# frontend / backend / desktop / packages/shared 변경 후 push 시 사용하세요.
#
# Usage: # Usage:
# ./scripts/push-with-desktop-version.sh [git push 인자...] # ./scripts/push-with-desktop-version.sh [git push 인자...]
# ./scripts/push-with-desktop-version.sh origin main # ./scripts/push-with-desktop-version.sh origin main