#!/usr/bin/env bash
set -e

echo "🛑 Stopping OpenGist (PVC will be kept)..."

kubectl scale deployment opengist --replicas=0

echo "⏳ Waiting for pod termination..."
kubectl wait --for=delete pod -l app=opengist --timeout=60s || true

echo "✅ OpenGist stopped (data preserved)"

