From 103b2f14f9dd5be90809f8acc33b107dcdec380a Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Fri, 14 Jul 2017 09:03:14 +0200 Subject: [PATCH] Fix drone Fix service container host name check current folder Fix more hostnames Signed-off-by: Morris Jobke --- autotest.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/autotest.sh b/autotest.sh index 3f62657a90..be65ae165a 100755 --- a/autotest.sh +++ b/autotest.sh @@ -200,7 +200,7 @@ function execute_tests { fi mysql -u "$DATABASEUSER" -powncloud -e "DROP DATABASE IF EXISTS $DATABASENAME" -h $DATABASEHOST || true else - DATABASEHOST=127.0.0.1 + DATABASEHOST=mysql fi fi echo "Waiting for MySQL initialisation ..." @@ -254,6 +254,17 @@ function execute_tests { echo "Postgres is up." else + if [ ! -z "$DRONE" ] ; then + DATABASEHOST=postgres + fi + echo "Waiting for Postgres to be available ..." + if ! apps/files_external/tests/env/wait-for-connection $DATABASEHOST 5432 60; then + echo "[ERROR] Waited 60 seconds, no response" >&2 + exit 1 + fi + echo "Give it 10 additional seconds ..." + sleep 10 + if [ -z "$DRONE" ] ; then # no need to drop the DB when we are on CI dropdb -U "$DATABASEUSER" "$DATABASENAME" || true fi