-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug-sprite.sh
More file actions
executable file
·47 lines (36 loc) · 1.69 KB
/
debug-sprite.sh
File metadata and controls
executable file
·47 lines (36 loc) · 1.69 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
#!/bin/bash
set -e
SPRITE_NAME="${1:-my-app}"
echo "🔍 Debugging Sprite: $SPRITE_NAME"
echo ""
# Check if SPRITE_TOKEN is set
if [ -z "$SPRITE_TOKEN" ]; then
echo "❌ SPRITE_TOKEN not set"
exit 1
fi
echo "1️⃣ Checking sprite info..."
curl -s -H "Authorization: Bearer $SPRITE_TOKEN" \
"https://api.sprites.dev/v1/sprites/$SPRITE_NAME" | jq .
echo ""
echo "2️⃣ Checking service definition..."
curl -s -H "Authorization: Bearer $SPRITE_TOKEN" \
"https://api.sprites.dev/v1/sprites/$SPRITE_NAME/services/hyperstar-app" | jq .
echo ""
echo "3️⃣ Checking service status..."
curl -s -H "Authorization: Bearer $SPRITE_TOKEN" \
"https://api.sprites.dev/v1/sprites/$SPRITE_NAME/services/hyperstar-app/status" | jq .
echo ""
echo "4️⃣ Getting service logs (last 50 lines)..."
curl -s -H "Authorization: Bearer $SPRITE_TOKEN" \
"https://api.sprites.dev/v1/sprites/$SPRITE_NAME/services/hyperstar-app/logs?lines=50"
echo ""
echo "5️⃣ Checking if files exist in /app..."
sprite api -s "$SPRITE_NAME" /exec -XPOST --data-urlencode "cmd=ls" --data-urlencode "cmd=-la" --data-urlencode "cmd=/app" --data-urlencode "stdin=false"
echo ""
echo "6️⃣ Checking if bun can find the app..."
sprite api -s "$SPRITE_NAME" /exec -XPOST --data-urlencode "cmd=bun" --data-urlencode "cmd=run" --data-urlencode "cmd=--version" --data-urlencode "dir=/app" --data-urlencode "stdin=false"
echo ""
echo "7️⃣ Testing direct bun run (should see error if any)..."
sprite api -s "$SPRITE_NAME" /exec -XPOST --data-urlencode "cmd=bun" --data-urlencode "cmd=run" --data-urlencode "cmd=app.ts" --data-urlencode "dir=/app" --data-urlencode "stdin=false" --data-urlencode "env=PORT=8080"
echo ""
echo "✅ Debug complete!"