-
-
Save digitaldreamer/3c8b9a858481f7132ec022764fdea528 to your computer and use it in GitHub Desktop.
circle wait for db
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
TIMEOUT=5 | |
until psql -h $PG_HOST -U $PG_USER -d $PG_DATABASE -c "select 1" > /dev/null 2>&1 || [ $TIMEOUT -eq 0 ]; do | |
echo "Waiting for postgres server, $((TIMEOUT--)) remaining attempts..." | |
sleep 1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment