Skip to content

Commit 9380782

Browse files
committed
fix: update sdk gen script
1 parent d38c62f commit 9380782

2 files changed

Lines changed: 13 additions & 12 deletions

File tree

‎scripts/doc-extract-macos.sh‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
#
1111

1212
# The api-gateway is exposed on port 8888 in docker-compose-dev.yml
13-
gateway_public_port=8888
13+
# extract gateway information from running juno instance
14+
gateway_container_id=$(docker ps -q --filter "ancestor=juno-api-gateway")
15+
gateway_container_port=$(docker port $gateway_container_id)
16+
17+
gateway_public_port=$(echo "$gateway_container_port" | grep -o "0.0.0.0:[0-9]*" | cut -d':' -f2) # MACOS version
1418

1519
# grab doc yaml
16-
curl -f "localhost:$gateway_public_port/docs-yaml" > docs-yaml
17-
if [ $? -ne 0 ]; then
18-
echo "Error: Failed to fetch docs-yaml. Is Juno running? (pnpm dev)"
19-
exit 1
20-
fi
20+
curl "localhost:$gateway_public_port/docs-yaml" > docs-yaml
2121

2222
# run gen client sdk script
2323
pnpm gen-client-sdk
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@
1010
#
1111

1212
# The api-gateway is exposed on port 8888 in docker-compose-dev.yml
13-
gateway_public_port=8888
13+
# Extract gateway information from running juno instance
14+
gateway_container_id=$(docker ps -q --filter "ancestor=juno-api-gateway")
15+
gateway_container_port=$(docker port $gateway_container_id)
16+
17+
gateway_public_port=$(echo "$gateway_container_port" | grep -oP "0.0.0.0:\K\d+")
18+
# gateway_public_port=$(echo "$gateway_container_port" | grep -o "0.0.0.0:[0-9]*" | cut -d':' -f2) # MACOS version
1419

1520
# grab doc yaml
16-
curl -f "localhost:$gateway_public_port/docs-yaml" > docs-yaml
17-
if [ $? -ne 0 ]; then
18-
echo "Error: Failed to fetch docs-yaml. Is Juno running? (pnpm dev)"
19-
exit 1
20-
fi
21+
curl "localhost:$gateway_public_port/docs-yaml" > docs-yaml
2122

2223
# run gen client sdk script
2324
pnpm gen-client-sdk

0 commit comments

Comments
 (0)