sozsoft-platform/configs/deployment/scripts/deploy/app.sh
2026-08-15 09:30:36 +03:00

43 lines
2.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.

export ENV=${1:-dev}
echo "Env değeri: ${ENV}"
cd ~/sozsoft-platform/configs/deployment
docker compose -f docker-compose-app.yml -f docker-compose-app.${ENV}.yml --profile api stop
docker compose -f docker-compose-app.yml -f docker-compose-app.${ENV}.yml --profile api rm -f
docker compose -f docker-compose-app.yml -f docker-compose-app.${ENV}.yml --profile ui stop
docker compose -f docker-compose-app.yml -f docker-compose-app.${ENV}.yml --profile ui rm -f
cd ~/sozsoft-platform
git checkout main
# --tags --force: sürüm notları git tag'lerinden üretiliyor; yerel tag origin'den
# farklı commit'e bakıyorsa --force olmadan reddedilir ve yeni tag'ler gelmez.
git fetch --prune --prune-tags --tags --force && git pull
# Sürüm notları imaja gömülü değil; konteynere configs/release-notes klasöründen
# mount ediliyor ve API açılışta veritabanına senkronize ediyor (DbMigrator
# gerekmez). `bash ...` ile çağrılır: depo Windows'tan yönetildiği için
# çalıştırma biti kaybolunca "Permission denied" verip notları sessizce düşürüyordu.
RELEASE_NOTES=~/sozsoft-platform/configs/release-notes/release-notes.json
bash ~/sozsoft-platform/configs/release-notes/generate-release-notes.sh
# Dosya yoksa API açılışta "release-notes.json bulunamadı" uyarısı verir ve
# changelog eskir; sessizce devam etmek yerine burada dur.
if [ ! -s "$RELEASE_NOTES" ]; then
echo "HATA: ${RELEASE_NOTES} üretilemedi, deploy durduruldu." >&2
exit 1
fi
cd ~/sozsoft-platform/configs/deployment
docker compose -f docker-compose-app.yml -f docker-compose-app.${ENV}.yml --profile api pull
docker compose -f docker-compose-app.yml -f docker-compose-app.${ENV}.yml --profile api up -d
# API_URL="https://api.sozsoft.com/api/app/platform-tenant?skipCount=0&maxResultCount=1"
# echo "sozsoft-api açılması bekleniyor: $API_URL"
# until curl -fsS --max-time 5 -o /dev/null "$API_URL"; do
# sleep 2
# done
docker compose -f docker-compose-app.yml -f docker-compose-app.${ENV}.yml --profile ui pull
docker compose -f docker-compose-app.yml -f docker-compose-app.${ENV}.yml --profile ui up -d