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

MANIFESTS_DIR="./manifests"

echo "🚀 Deploying OpenGist from ${MANIFESTS_DIR} ..."

kubectl apply -f "${MANIFESTS_DIR}/opengist-pvc.yaml"
kubectl apply -f "${MANIFESTS_DIR}/opengist-deployment.yaml"
kubectl apply -f "${MANIFESTS_DIR}/opengist-svc-web.yaml"
kubectl apply -f "${MANIFESTS_DIR}/opengist-svc-ssh.yaml"
kubectl apply -f "${MANIFESTS_DIR}/opengist-ingress.yaml"

echo "⏳ Waiting for deployment to be ready..."
kubectl rollout status deployment/opengist

echo "✅ OpenGist deployed successfully"

