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.
|
|
|
|
|
|
git fetch --prune --prune-tags --tags && git pull
|
2026-02-24 20:44:16 +00:00
|
|
|
|
|
|
|
|
|
|
cd ~/sozsoft-platform/ui
|
|
|
|
|
|
|
2026-08-12 19:08:14 +00:00
|
|
|
|
# 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)}
|
2026-02-24 20:44:16 +00:00
|
|
|
|
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
|