Fix: --unshallow vor --tags fetch damit git describe funktioniert

Shallow clones (--depth=1) kennen keine Tag-Historie. --unshallow
konvertiert zuerst zum vollständigen Clone, danach sind alle Tags erreichbar.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
main
boban 2026-04-24 13:46:50 +02:00
parent fbce5dc8ba
commit 5b9e486b98
1 changed files with 2 additions and 1 deletions

View File

@ -802,7 +802,8 @@ git config --global --add safe.directory "${APP_DIR}" || true
# ===== Version-Datei schreiben ===== # ===== Version-Datei schreiben =====
mkdir -p /var/lib/mailwolt mkdir -p /var/lib/mailwolt
sudo -u "$APP_USER" -H bash -lc "git -C ${APP_DIR} fetch --tags --depth=1 origin 2>/dev/null || true" sudo -u "$APP_USER" -H bash -lc "git -C ${APP_DIR} fetch --unshallow 2>/dev/null || true"
sudo -u "$APP_USER" -H bash -lc "git -C ${APP_DIR} fetch --tags origin 2>/dev/null || true"
GIT_TAG="$(sudo -u "$APP_USER" -H bash -lc "git -C ${APP_DIR} describe --tags --abbrev=0 2>/dev/null || echo ''")" GIT_TAG="$(sudo -u "$APP_USER" -H bash -lc "git -C ${APP_DIR} describe --tags --abbrev=0 2>/dev/null || echo ''")"
if [ -n "$GIT_TAG" ]; then if [ -n "$GIT_TAG" ]; then
echo "${GIT_TAG#v}" > /var/lib/mailwolt/version echo "${GIT_TAG#v}" > /var/lib/mailwolt/version