Files
bogazici-admin/scripts/deploy-prod.sh
Bulut Kuru f46b9d795d deploy 1
2026-03-27 21:06:38 +03:00

29 lines
710 B
Bash
Executable File
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 -euo pipefail
PROJECT_DIR="/opt/projects/bogazici/corporate-admin/prod/admin"
BRANCH="main"
CONTAINER="bdc-admin-prod"
COMPOSE_FILE="docker-compose.prod.yml"
echo "🚀 [Admin] Prod deploy başlatılıyor..."
cd "$PROJECT_DIR"
# Git sync
git fetch origin
git checkout "$BRANCH"
git reset --hard "origin/$BRANCH"
git clean -fd
# Docker - stop & remove any existing container first
docker stop "$CONTAINER" 2>/dev/null || true
docker rm "$CONTAINER" 2>/dev/null || true
docker compose -f "$COMPOSE_FILE" down --remove-orphans 2>/dev/null || true
docker compose -f "$COMPOSE_FILE" up -d --build
# Cleanup
docker image prune -f 2>/dev/null || true
echo "✅ [Admin] Prod deploy tamamlandı"