Last active
December 19, 2019 16:55
-
-
Save fbiville/afd02a39d186ae8f297503d5c8339413 to your computer and use it in GitHub Desktop.
Wait for Spring Boot's health status to be up
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
#!/bin/bash | |
set -Eeuo pipefail | |
get_health_status() { | |
curl --request GET http://localhost:8080/actuator/health 2> /dev/null | jq --raw-output '.status' | |
} | |
main() { | |
while [ "$(get_health_status)" != "UP" ]; do | |
echo '(┛ಠ_ಠ)┛彡┻━┻ endpoint not up yet' | |
sleep ${1} | |
done | |
echo '┬─┬ノ( º _ ºノ) endpoint up!' | |
} | |
main ${1:-2} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment