Skip to content

Commit

Permalink
Merge pull request #41 from PrefectHQ/apollo_entrypoint
Browse files Browse the repository at this point in the history
Update apollo post-start to wait for graphql service
  • Loading branch information
cicdw authored Aug 13, 2020
2 parents bddc98b + 9ec5b63 commit 8f3c5ef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changes/pr41.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
enhancement:
- "Set Apollo's `post-start.sh` script to wait for the GraphQL service's healthcheck - [#41](https://github.com/PrefectHQ/server/pull/41)"
7 changes: 6 additions & 1 deletion services/apollo/post-start.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#!/bin/bash
set -eu
curl -s $GRAPHQL_SERVICE_HOST:$GRAPHQL_SERVICE_PORT/health | grep $PREFECT_SERVER_VERSION && echo "Service Healthy" || kill 1

while true; do
curl -s $GRAPHQL_SERVICE_HOST:$GRAPHQL_SERVICE_PORT/health | grep "ok" \
&& echo "GraphQL service healthy!" && break
sleep 1
done

0 comments on commit 8f3c5ef

Please sign in to comment.