diff options
author | Morris Jobke <hey@morrisjobke.de> | 2016-06-23 10:48:20 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2016-06-23 10:48:20 +0200 |
commit | 41436fecc29d2c4d46a4bd651a99de875c3d8a74 (patch) | |
tree | 580ed0fec827a9b562dbf840eebb7ba087221884 | |
parent | 77c11758945f863e9bbf91a2e08952ea6999c237 (diff) | |
download | nextcloud-server-41436fecc29d2c4d46a4bd651a99de875c3d8a74.tar.gz nextcloud-server-41436fecc29d2c4d46a4bd651a99de875c3d8a74.zip |
Add mysql job to CI
-rw-r--r-- | .drone.yml | 14 | ||||
-rwxr-xr-x | autotest.sh | 16 |
2 files changed, 24 insertions, 6 deletions
diff --git a/.drone.yml b/.drone.yml index 4d0a0aba2a8..df58c126a05 100644 --- a/.drone.yml +++ b/.drone.yml @@ -17,6 +17,13 @@ build: - git submodule update --init - ./occ maintenance:install --database-name oc_autotest --database-user oc_autotest --admin-user admin --admin-pass admin --database sqlite --database-pass='' - ./autotest.sh sqlite + mysql: + image: morrisjobke/nextcloud-ci-php7:1.0.4 + commands: + - sleep 10 # gives the database enough time to initialize + - rm -rf data/* config/config.php # TODO: remove this - temporary fix for CI issues + - git submodule update --init + - ./autotest.sh mysql postgres: image: morrisjobke/nextcloud-ci-php7:1.0 commands: @@ -33,3 +40,10 @@ compose: environment: - POSTGRES_USER=oc_autotest - POSTGRES_PASSWORD=oc_autotest + mysql: + image: mysql + environment: + - MYSQL_ROOT_PASSWORD=owncloud + - MYSQL_USER=oc_autotest + - MYSQL_PASSWORD=owncloud + - MYSQL_DATABASE=oc_autotest diff --git a/autotest.sh b/autotest.sh index 4dda2be43e5..b56394dc9df 100755 --- a/autotest.sh +++ b/autotest.sh @@ -200,12 +200,16 @@ function execute_tests { echo "MySQL is up." else - 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 + 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 fi if [ "$DB" == "mariadb" ] ; then |