erp-platform/ui/scripts/generate-version.sh

34 lines
693 B
Bash
Raw Normal View History

2025-09-22 18:53:03 +00:00
#!/bin/bash
set -e
echo "> version.json oluşturuluyor..."
cd ~/kurs-platform/ui
VERSIONS=$(git tag --sort=creatordate)
OUTPUT="{\"releases\":["
FIRST=true
for TAG in $VERSIONS; do
VER=$(echo $TAG | sed 's/^v//')
DATE=$(git log -1 --format=%ad --date=short $TAG)
COMMIT=$(git rev-list -n 1 $TAG)
MESSAGE=$(git tag -l --format="%(contents)" $TAG | jq -R . | jq -s .)
if [ "$FIRST" = true ]; then
FIRST=false
else
OUTPUT+=","
fi
OUTPUT+="{\"version\":\"$VER\",\"buildDate\":\"$DATE\",\"commit\":\"$COMMIT\",\"changeLog\":$MESSAGE}"
done
OUTPUT+="]}"
echo "$OUTPUT" | jq . > public/version.json
echo "> public/version.json güncellendi:"
cat public/version.json