-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy-all-services.sh
More file actions
executable file
·81 lines (68 loc) · 2.2 KB
/
deploy-all-services.sh
File metadata and controls
executable file
·81 lines (68 loc) · 2.2 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
#!/bin/bash
# Deploy all ESG microservices to Firebase emulator
echo "🚀 Deploying all ESG microservices to Firebase emulator..."
# Set environment variables
export FIRESTORE_PROJECT_ID="your-project-id"
# Function to deploy a service
deploy_service() {
local service_name=$1
local port=$2
echo "📦 Deploying $service_name on port $port..."
cd "services/$service_name"
# Install dependencies
npm install
# Create firebase.json for this service if it doesn't exist
if [ ! -f "firebase.json" ]; then
cat > firebase.json << EOF
{
"functions": {
"source": ".",
"runtime": "nodejs18"
},
"emulators": {
"functions": {
"port": $port
},
"ui": {
"enabled": false
}
}
}
EOF
fi
# Wait for service to be available (the emulator should already be running)
sleep 3
# Test health endpoint
curl -s "http://localhost:$port/esg-$service_name/us-central1/health" > /dev/null
if [ $? -eq 0 ]; then
echo "✅ $service_name is available on port $port"
return 0
else
echo "❌ $service_name is not available on port $port"
return 1
fi
cd ../..
}
# Deploy all services
echo "🔄 Checking services in Firebase emulator..."
deploy_service "category-extraction-service" "5001"
deploy_service "product-extraction-service" "5002"
deploy_service "embedding-service" "5003"
deploy_service "orchestrator-service" "5004"
deploy_service "product-data-enrichment-service" "5005"
deploy_service "ai-logging-service" "5007"
deploy_service "vector-search-service" "5008"
echo "🎉 Service deployment check completed!"
echo ""
echo "📊 Service Status:"
echo " Category Extraction: http://localhost:5001"
echo " Product Extraction: http://localhost:5002"
echo " Embedding Service: http://localhost:5003"
echo " Orchestrator: http://localhost:5004"
echo " Enrichment Service: http://localhost:5005"
echo " AI Logging Service: http://localhost:5007"
echo " Vector Search: http://localhost:5008"
echo " Firestore: http://localhost:8080"
echo " Firebase UI: http://127.0.0.1:4000"
echo ""
echo "🔧 To stop all services: ./stop-all-services.sh"