Add mysql job to CI
This commit is contained in:
parent
77c1175894
commit
41436fecc2
14
.drone.yml
14
.drone.yml
|
@ -17,6 +17,13 @@ build:
|
||||||
- git submodule update --init
|
- 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=''
|
- ./occ maintenance:install --database-name oc_autotest --database-user oc_autotest --admin-user admin --admin-pass admin --database sqlite --database-pass=''
|
||||||
- ./autotest.sh sqlite
|
- ./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:
|
postgres:
|
||||||
image: morrisjobke/nextcloud-ci-php7:1.0
|
image: morrisjobke/nextcloud-ci-php7:1.0
|
||||||
commands:
|
commands:
|
||||||
|
@ -33,3 +40,10 @@ compose:
|
||||||
environment:
|
environment:
|
||||||
- POSTGRES_USER=oc_autotest
|
- POSTGRES_USER=oc_autotest
|
||||||
- POSTGRES_PASSWORD=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
|
||||||
|
|
16
autotest.sh
16
autotest.sh
|
@ -200,12 +200,16 @@ function execute_tests {
|
||||||
echo "MySQL is up."
|
echo "MySQL is up."
|
||||||
|
|
||||||
else
|
else
|
||||||
if [ "mysql" != "$(mysql --version | grep -o mysql)" ] ; then
|
if [ -z "$DRONE" ] ; then # no need to drop the DB when we are on CI
|
||||||
echo "Your mysql binary is not provided by mysql"
|
if [ "mysql" != "$(mysql --version | grep -o mysql)" ] ; then
|
||||||
echo "To use the docker container set the USEDOCKER environment variable"
|
echo "Your mysql binary is not provided by mysql"
|
||||||
exit -1
|
echo "To use the docker container set the USEDOCKER environment variable"
|
||||||
fi
|
exit -1
|
||||||
mysql -u "$DATABASEUSER" -powncloud -e "DROP DATABASE IF EXISTS $DATABASENAME" -h $DATABASEHOST || true
|
fi
|
||||||
|
mysql -u "$DATABASEUSER" -powncloud -e "DROP DATABASE IF EXISTS $DATABASENAME" -h $DATABASEHOST || true
|
||||||
|
else
|
||||||
|
DATABASEHOST=127.0.0.1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ "$DB" == "mariadb" ] ; then
|
if [ "$DB" == "mariadb" ] ; then
|
||||||
|
|
Loading…
Reference in New Issue