CoolFace
Apppublic

danielsanga/personalagent-integration

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
rollback.sh36 linesDownload Raw Back to scripts
1#!/usr/bin/env bash2# rollback.sh — Points the given service back to the previous healthy deploy.3# Usage: APPROVE=true SERVICE=orchestrator bash rollback.sh4set -euo pipefail5 6if [[ "${APPROVE:-false}" != "true" ]]; then7  echo "❌ Refusing to rollback: APPROVE env var is not set to 'true'."8  echo "   Re-run with: APPROVE=true bash rollback.sh"9  exit 110fi11 12SERVICE="${SERVICE:?SERVICE is required (e.g. orchestrator, interface)}"13 14echo "⏪ Rolling back $SERVICE..."15 16case "$SERVICE" in17  interface)18    echo "Vercel rollback: promoting previous deployment..."19    # VERCEL_DEPLOYMENT_ID should be set to the target deployment URL or ID20    npx vercel rollback "${VERCEL_DEPLOYMENT_ID:?VERCEL_DEPLOYMENT_ID is required}" \21      --token "${VERCEL_TOKEN:?VERCEL_TOKEN is required}" \22      --yes23    ;;24  orchestrator)25    echo "Render rollback not directly supported via API."26    echo "Go to your Render dashboard and select a previous deploy to re-deploy it."27    echo "  https://dashboard.render.com"28    ;;29  *)30    echo "Unknown service: $SERVICE. Valid values: interface, orchestrator"31    exit 132    ;;33esac34 35echo "✅ Rollback complete for $SERVICE."36