diff --git a/Dockerfile b/Dockerfile index 923a136..7bef078 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 && \ diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 70e9039..82ac035 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -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