Version-Anzeige: Neuesten Git-Tag statt Commit-Hash verwenden

This commit is contained in:
Hördle Bot
2025-12-14 14:24:42 +01:00
parent b7293a4614
commit fb3e4c10dd
2 changed files with 7 additions and 3 deletions

View File

@@ -27,7 +27,9 @@ COPY . .
RUN if [ -n "$APP_VERSION" ]; then \
echo "$APP_VERSION" > /tmp/version.txt; \
else \
(git describe --tags --always 2>/dev/null || \
(git describe --tags --exact-match 2>/dev/null || \
git describe --tags --abbrev=0 2>/dev/null || \
git tag --sort=-version:refname | head -1 2>/dev/null || \
(grep -o '"version": "[^"]*"' package.json 2>/dev/null | cut -d'"' -f4 | sed 's/^/v/') || \
echo "dev") > /tmp/version.txt; \
fi && \

View File

@@ -63,8 +63,10 @@ fi
./scripts/backup-restic.sh
# Nur neueste Version holen (shallow fetch), vollständiges Repo ist im Deployment nicht nötig
echo "📥 Fetching latest commit (shallow clone) from git..."
git fetch --prune --tags --depth=1 origin master
# Wichtig: Tags müssen vollständig geholt werden für Version-Anzeige
echo "📥 Fetching latest commit and all tags from git..."
git fetch --prune --tags origin master
git fetch --tags origin
git reset --hard origin/master
# Prüfe und erstelle/repariere Netzwerk falls nötig