From f344899b677b0533a0cfc166fd93c5024c1af3bc Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Tue, 18 Aug 2015 15:03:27 -0700 Subject: [PATCH] Use /healthcheck to wait till gogs comes up --- CloudronManifest.json | 2 +- start.sh | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CloudronManifest.json b/CloudronManifest.json index 9d07716..f3d2637 100644 --- a/CloudronManifest.json +++ b/CloudronManifest.json @@ -5,7 +5,7 @@ "description": "file://DESCRIPTION.md", "tagline": "A painless self-hosted Git Service", "version": "0.1.2", - "healthCheckPath": "/", + "healthCheckPath": "/healthcheck", "httpPort": 3000, "addons": { "mysql": { }, diff --git a/start.sh b/start.sh index 5496633..a1b0e5b 100755 --- a/start.sh +++ b/start.sh @@ -34,7 +34,11 @@ chown cloudron:cloudron /home/cloudron/gogs/custom/conf/app.ini /usr/bin/supervisord --configuration /etc/supervisor/supervisord.conf --nodaemon -i Gogs & -sleep 10 # on first run, lets gogs finish the db setup +# Wait for gogs to finish db setup, before we insert ldap source in db +while curl --fail http://localhost:3000/healthcheck; do + echo "Waiting for gogs to come up" + sleep 1 +done # id, type, name, is_actived, cfg, allow_auto_register, created, updated mysql -u"${MYSQL_USERNAME}" -p"${MYSQL_PASSWORD}" -h mysql --database="${MYSQL_DATABASE}" \