danielsanga/personalagent-integration
0
1#!/usr/bin/env bash2# deploy.sh — MANUAL deploy trigger.3# Must be called with APPROVE=true or it will refuse to run.4# Usage: APPROVE=true SERVICE=orchestrator bash deploy.sh5set -euo pipefail6 7if [[ "${APPROVE:-false}" != "true" ]]; then8 echo "❌ Refusing to deploy: APPROVE env var is not set to 'true'."9 echo " Re-run with: APPROVE=true bash deploy.sh"10 exit 111fi12 13SERVICE="${SERVICE:?SERVICE is required (e.g. orchestrator, interface)}"14 15echo "✅ Approval confirmed. Deploying $SERVICE..."16 17case "$SERVICE" in18 interface)19 echo "Triggering Vercel deploy for interface..."20 # Requires VERCEL_TOKEN in environment21 npx vercel --prod --yes --token "${VERCEL_TOKEN:?VERCEL_TOKEN is required}"22 ;;23 orchestrator)24 echo "Triggering Render deploy for orchestrator via webhook..."25 curl --fail --silent --show-error \26 --request POST \27 "${RENDER_DEPLOY_HOOK_URL:?RENDER_DEPLOY_HOOK_URL is required}"28 echo ""29 ;;30 *)31 echo "Unknown service: $SERVICE. Valid values: interface, orchestrator"32 exit 133 ;;34esac35 36echo "🚀 Deploy triggered for $SERVICE."37 