-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathdeploy-functions.sh
More file actions
88 lines (76 loc) · 2.45 KB
/
deploy-functions.sh
File metadata and controls
88 lines (76 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/Users/bruzwj/Downloads/.env.local#!/bin/bash
# Deployment script for Supabase Edge Functions
# Run this when Docker is working properly
if [ -f .env.local ]; then
# Load environment variables, handling = signs and quotes properly
set -a
source .env.local
set +a
fi
echo "🚀 Deploying Supabase Edge Functions..."
# Debug: Check if variables are loaded
echo "Debug: SUPABASE_ACCESS_TOKEN is ${#SUPABASE_ACCESS_TOKEN} characters long"
echo "Debug: SUPABASE_PROJECT_REF = $SUPABASE_PROJECT_REF"
# Ensure variables are set
if [ -z "$SUPABASE_ACCESS_TOKEN" ]; then
echo "Error: SUPABASE_ACCESS_TOKEN not found in .env.local"
exit 1
fi
if [ -z "$SUPABASE_PROJECT_REF" ]; then
echo "Error: SUPABASE_PROJECT_REF not found in .env.local"
exit 1
fi
# Deploy functions that require --no-verify-jwt flag
no_verify_jwt_functions=(
"alpaca-batch"
"alpaca-proxy"
"settings-proxy"
"execute-trade"
"analysis-coordinator"
"rebalance-coordinator"
"send-invitation"
"discord-role-sync"
"stripe-webhook"
"create-smart-session"
)
echo "📦 Deploying functions with --no-verify-jwt flag..."
for func in "${no_verify_jwt_functions[@]}"; do
echo " 📦 Deploying $func..."
SUPABASE_ACCESS_TOKEN=$SUPABASE_ACCESS_TOKEN npx supabase functions deploy $func --project-ref $SUPABASE_PROJECT_REF --no-verify-jwt
done
# Deploy functions that use standard JWT verification
standard_functions=(
"process-scheduled-rebalances"
"detect-stale-analysis"
"auto-near-limit-analysis"
)
echo "📦 Deploying functions with standard JWT verification..."
for func in "${standard_functions[@]}"; do
echo " 📦 Deploying $func..."
SUPABASE_ACCESS_TOKEN=$SUPABASE_ACCESS_TOKEN npx supabase functions deploy $func --project-ref $SUPABASE_PROJECT_REF
done
# Deploy all agent functions
agents=(
"agent-macro-analyst"
"agent-market-analyst"
"agent-news-analyst"
"agent-social-media-analyst"
"agent-fundamentals-analyst"
"agent-bull-researcher"
"agent-bear-researcher"
"agent-research-manager"
"agent-trader"
"agent-risky-analyst"
"agent-safe-analyst"
"agent-neutral-analyst"
"agent-risk-manager"
"analysis-portfolio-manager"
"rebalance-portfolio-manager"
"opportunity-agent"
)
echo "📦 Deploying agent functions..."
for agent in "${agents[@]}"; do
echo " 📦 Deploying $agent..."
SUPABASE_ACCESS_TOKEN=$SUPABASE_ACCESS_TOKEN npx supabase functions deploy $agent --project-ref $SUPABASE_PROJECT_REF
done
echo "✅ All functions deployed successfully!"