sozsoft-platform/configs/deployment/scripts/build/ui.sh
2026-08-12 22:08:14 +03:00

29 lines
1.1 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
export ENV=${1:-dev}
echo "Env değeri: ${ENV}"
cd ~/sozsoft-platform
git checkout main
# --prune-tags: sunucuda elle atılmış, origin'de olmayan yerel tag'leri siler.
# Bunlar temizlenmezse `git tag` listesinde kalır ve deploy yanlış (daha yüksek)
# bir sürüm numarasıyla etiketlenir.
git fetch --prune --prune-tags --tags && git pull
cd ~/sozsoft-platform/ui
# Sürüm, HEAD'den erişilebilen son tag'dir (başka daldaki tag'ler sayılmaz);
# tag yoksa package.json'daki sürüm kullanılır.
VERSION=$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//')
VERSION=${VERSION:-$(jq -r .version package.json)}
echo "Build versiyonu: ${VERSION}"
# Deploy öncesi git üzerindeki tüm versiyon bilgilerini güncelle
./scripts/generate-version.sh
docker build \
-t devops.sozsoft.com/sozsoft/sozsoft-platform-ui:${ENV}-${VERSION} \
-t devops.sozsoft.com/sozsoft/sozsoft-platform-ui:${ENV}-latest \
-f Sozsoft.Platform.Ui.Dockerfile --build-arg ENV=${ENV} .
docker push devops.sozsoft.com/sozsoft/sozsoft-platform-ui:${ENV}-${VERSION}
docker push devops.sozsoft.com/sozsoft/sozsoft-platform-ui:${ENV}-latest