2026-02-24 20:44:16 +00:00
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
export ENV=${1:-dev}
|
|
|
|
|
|
echo "Env değeri: ${ENV}"
|
|
|
|
|
|
|
|
|
|
|
|
cd ~/sozsoft-platform
|
|
|
|
|
|
git checkout main
|
2026-08-12 19:08:14 +00:00
|
|
|
|
# --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.
|
2026-08-12 21:26:36 +00:00
|
|
|
|
git fetch --prune --prune-tags --tags --force && git pull
|
2026-02-24 20:44:16 +00:00
|
|
|
|
|
|
|
|
|
|
cd ~/sozsoft-platform/ui
|
|
|
|
|
|
|
2026-08-12 21:26:36 +00:00
|
|
|
|
# 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.
|
2026-08-12 19:08:14 +00:00
|
|
|
|
VERSION=$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//')
|
2026-08-12 21:26:36 +00:00
|
|
|
|
VERSION=${VERSION:-$(git rev-parse --short HEAD)}
|
2026-02-24 20:44:16 +00:00
|
|
|
|
echo "Build versiyonu: ${VERSION}"
|
|
|
|
|
|
|
2026-08-12 21:26:36 +00:00
|
|
|
|
# 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.
|
2026-02-24 20:44:16 +00:00
|
|
|
|
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
|