Merge pull request #23 from tobias-trabelsi-sonarsource/master

fixed healthcheck as of image rework with 8.x release
This commit is contained in:
Tianon Gravi 2020-05-26 11:07:40 -07:00 committed by GitHub
commit f21cb9f59a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -2,9 +2,9 @@
# A Sonarqube container is considered healthy if the status is UP, DB_MIGRATION_NEEDED or DB_MIGRATION_RUNNING # A Sonarqube container is considered healthy if the status is UP, DB_MIGRATION_NEEDED or DB_MIGRATION_RUNNING
# status about migration are added to prevent the node to be kill while sonarqube is updating himself. # status about migration are added to prevent the node to be kill while sonarqube is updating himself.
host="$(hostname --ip-address || echo '127.0.0.1')" host="$(hostname -i || echo '127.0.0.1')"
if curl -Ss http://${host}:9000/api/system/status | grep -q -e '"status":"UP"' -e '"status":"DB_MIGRATION_NEEDED"' -e '"status":"DB_MIGRATION_RUNNING"'; then if wget -qO- http://${host}:9000/api/system/status | grep -q -e '"status":"UP"' -e '"status":"DB_MIGRATION_NEEDED"' -e '"status":"DB_MIGRATION_RUNNING"'; then
exit 0 exit 0
fi fi