Version-Anzeige: Neuesten Git-Tag statt Commit-Hash verwenden
This commit is contained in:
@@ -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 && \
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user