sozsoft-platform/configs/deployment/scripts/build/ui.sh
2026-08-13 00:26:36 +03:00

30 lines
1.3 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 --force && git pull
cd ~/sozsoft-platform/ui
# Yalnızca imaj etiketi: HEAD'den erişilebilen son tag (başka daldaki tag'ler
# sayılmaz), tag yoksa kısa commit. Uygulamanın gösterdiği sürüm buradan değil,
# backend'deki sürüm notları tablosundan gelir.
VERSION=$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//')
VERSION=${VERSION:-$(git rev-parse --short HEAD)}
echo "Build versiyonu: ${VERSION}"
# Sürüm numarası ve sürüm notları backend'de (Sürüm Notları tablosu) tutulur;
# UI tarafında üretilecek bir sürüm dosyası yoktur. Buradaki VERSION yalnızca
# imaj etiketidir.
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