aboutsummaryrefslogtreecommitdiffstats
path: root/autotest.sh
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2016-10-18 10:31:05 +0200
committerMorris Jobke <hey@morrisjobke.de>2016-10-19 00:15:01 +0200
commitd0a3d17912cbbf31e6a5dd93aa190c48283de1cc (patch)
tree4916f49c715bb31e2dba51ca6c02807c1783eb54 /autotest.sh
parent9356a0e5830a82ddcf48d52ffc48a8fb8f7b68a7 (diff)
downloadnextcloud-server-d0a3d17912cbbf31e6a5dd93aa190c48283de1cc.tar.gz
nextcloud-server-d0a3d17912cbbf31e6a5dd93aa190c48283de1cc.zip
add 4 byte mysql test run
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'autotest.sh')
-rwxr-xr-xautotest.sh32
1 files changed, 23 insertions, 9 deletions
diff --git a/autotest.sh b/autotest.sh
index 4364e41fa34..c77562e7602 100755
--- a/autotest.sh
+++ b/autotest.sh
@@ -210,16 +210,30 @@ function execute_tests {
fi
fi
if [ "$DB" == "mysqlmb4" ] ; then
- echo "Fire up the mysql docker"
- DOCKER_CONTAINER_ID=$(docker run \
- -v $BASEDIR/tests/docker/mysqlmb4:/etc/mysql/conf.d \
- -e MYSQL_ROOT_PASSWORD=owncloud \
- -e MYSQL_USER="$DATABASEUSER" \
- -e MYSQL_PASSWORD=owncloud \
- -e MYSQL_DATABASE="$DATABASENAME" \
- -d mysql:5.7)
+ if [ ! -z "$USEDOCKER" ] ; then
+ echo "Fire up the mysql docker"
+ DOCKER_CONTAINER_ID=$(docker run \
+ -v $BASEDIR/tests/docker/mysqlmb4:/etc/mysql/conf.d \
+ -e MYSQL_ROOT_PASSWORD=owncloud \
+ -e MYSQL_USER="$DATABASEUSER" \
+ -e MYSQL_PASSWORD=owncloud \
+ -e MYSQL_DATABASE="$DATABASENAME" \
+ -d mysql:5.7)
- DATABASEHOST=$(docker inspect --format="{{.NetworkSettings.IPAddress}}" "$DOCKER_CONTAINER_ID")
+ DATABASEHOST=$(docker inspect --format="{{.NetworkSettings.IPAddress}}" "$DOCKER_CONTAINER_ID")
+
+ else
+ if [ -z "$DRONE" ] ; then # no need to drop the DB when we are on CI
+ if [ "mysql" != "$(mysql --version | grep -o mysql)" ] ; then
+ echo "Your mysql binary is not provided by mysql"
+ echo "To use the docker container set the USEDOCKER environment variable"
+ exit -1
+ fi
+ mysql -u "$DATABASEUSER" -powncloud -e "DROP DATABASE IF EXISTS $DATABASENAME" -h $DATABASEHOST || true
+ else
+ DATABASEHOST=127.0.0.1
+ fi
+ fi
echo "Waiting for MySQL(utf8mb4) initialisation ..."