Skip to content

Instantly share code, notes, and snippets.

@fbiville
Last active December 19, 2019 16:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fbiville/afd02a39d186ae8f297503d5c8339413 to your computer and use it in GitHub Desktop.
Save fbiville/afd02a39d186ae8f297503d5c8339413 to your computer and use it in GitHub Desktop.
Wait for Spring Boot's health status to be up
#!/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