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

31 lines
1.2 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
set -e
cd ~/sozsoft-platform
git checkout main
git fetch --prune && git pull
cd ~/sozsoft-platform/api
# Sürüm notları burada ÜRETİLMEZ. Dosya api build context'i içindeyken her yeni
# tag Dockerfile'daki `COPY . .` katmanını geçersiz kılıyor ve kodda hiçbir
# değişiklik olmasa bile imaj baştan derleniyordu. Artık configs/release-notes
# altında deploy sırasında üretilip konteynere mount ediliyor
# (configs/deployment/scripts/deploy/app.sh).
VERSION=$(cat ~/sozsoft-platform/api/src/Sozsoft.Platform.HttpApi.Host/appsettings.json \
| grep -o '"[^"]*"\s*:\s*"[^"]*"' \
| grep -E '^"(Version)"' \
| sed 's/^.* //' \
| sed 's/"//g')
# DevExpress lisansını dosyadan oku (GitHub'a commit edilmemiş)
DEVEXPRESS_LICENSE=$(cat ~/sozsoft-platform/api/DevExpress_License.txt 2>/dev/null || echo "")
docker build \
--build-arg DevExpress_License="${DEVEXPRESS_LICENSE}" \
-t devops.sozsoft.com/sozsoft/sozsoft-platform-api:${VERSION} \
-t devops.sozsoft.com/sozsoft/sozsoft-platform-api:latest \
-f Sozsoft.Platform.HttpApi.Host.Dockerfile .
docker push devops.sozsoft.com/sozsoft/sozsoft-platform-api:${VERSION}
docker push devops.sozsoft.com/sozsoft/sozsoft-platform-api:latest