-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
58 lines (49 loc) · 1.31 KB
/
setup.sh
File metadata and controls
58 lines (49 loc) · 1.31 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
#!/bin/bash
set -e
echo "🚀 ZeroApp Setup Script"
echo "======================"
echo
# Check if Docker is running
if ! docker info > /dev/null 2>&1; then
echo "❌ Docker is not running. Please start Docker and try again."
exit 1
fi
# Start Restate runtime
echo "1️⃣ Starting Restate runtime..."
docker-compose up -d
# Wait for Restate to be ready
echo "⏳ Waiting for Restate runtime to be ready..."
sleep 3
MAX_RETRIES=30
RETRY_COUNT=0
while ! curl -s http://localhost:9070/health > /dev/null; do
RETRY_COUNT=$((RETRY_COUNT + 1))
if [ $RETRY_COUNT -gt $MAX_RETRIES ]; then
echo "❌ Restate runtime failed to start after 30 seconds"
exit 1
fi
echo " Waiting for Restate... ($RETRY_COUNT/$MAX_RETRIES)"
sleep 1
done
echo "✅ Restate runtime is ready"
echo
# Build the application
echo "2️⃣ Building application..."
cd backend
go build -o zeroapp
echo "✅ Application built successfully"
echo
# Instructions for next steps
echo "3️⃣ Next steps:"
echo
echo " a) Start the application in a new terminal:"
echo " cd backend"
echo " ./zeroapp"
echo
echo " b) Register services with Restate:"
echo " ./scripts/register-services.sh"
echo
echo " c) Open the frontend:"
echo " http://localhost:8081"
echo
echo "📝 See SETUP.md for more details"