#!/bin/bash

# SQDC Dashboard Rollback Script
# Usage: ./scripts/rollback.sh

set -e

NAMESPACE="sqdc-dashboard"

echo "⏪ Rolling back SQDC Dashboard deployment..."

kubectl rollout undo deployment/sqdc-dashboard -n $NAMESPACE

echo "⏳ Waiting for rollback to complete..."
kubectl rollout status deployment/sqdc-dashboard -n $NAMESPACE --timeout=5m

echo "✅ Rollback complete!"
kubectl get pods -n $NAMESPACE
