1
0
Nilton Constantino d48172539a
first commit
2026-04-22 14:55:58 +01:00

36 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
echo "=== Building bootJar ==="
./gradlew :app-monolith:bootJar --no-daemon
echo "=== Starting AI Gateway in Docker ==="
docker compose up --build -d
echo ""
echo "Waiting for gateway to start..."
for i in $(seq 1 30); do
if curl -sf http://localhost:8080/api/auth/token -X POST \
-H 'Content-Type: application/json' \
-d '{"clientId":"claude-mcp-agent","clientSecret":"secret","scopes":["db.read"]}' \
> /dev/null 2>&1; then
echo "Gateway is ready at http://localhost:8080"
echo ""
echo "Quick test — obtaining token:"
curl -s -X POST http://localhost:8080/api/auth/token \
-H 'Content-Type: application/json' \
-d '{"clientId":"claude-mcp-agent","clientSecret":"secret","scopes":["jira.read","jira.write","jenkins.deploy","db.read","db.migrate"]}' | python3 -m json.tool
echo ""
echo "Logs: docker compose logs -f"
echo "Stop: docker compose down"
exit 0
fi
sleep 1
done
echo "Gateway failed to start. Check logs:"
docker compose logs
exit 1