Skip to content

Commit

Permalink
Use Nextcloud for CI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Leon Klingele committed Sep 27, 2016
1 parent 4576820 commit fdc9f8b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 33 deletions.
6 changes: 3 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
variables:
OWNCLOUD_BRANCH: master
OWNCLOUD_DATABASE: mysql
NC_BRANCH: master
NC_DATABASE: mysql

runtests:
script:
# install system dependencies
- ci-apt-get-update
- ci-apt-get-install mysql-client mysql-server phpunit php5-curl php5-gd php5-intl php5-mysql
- ./tests/prepare-ci-tests.sh
- cd ${CI_PROJECT_DIR}/../owncloud/apps/spreedme
- cd ${CI_PROJECT_DIR}/../nextcloud/apps/spreedme
- phpunit -c phpunit.xml
- phpunit -c phpunit.integration.xml
18 changes: 9 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,32 @@ php:

env:
global:
- OWNCLOUD_BRANCH=master
- NC_BRANCH=master
matrix:
- OWNCLOUD_DATABASE=mysql
- NC_DATABASE=mysql

matrix:
allow_failures:
- php: hhvm
include:
- php: 5.5
env: OWNCLOUD_DATABASE=sqlite
env: NC_DATABASE=sqlite
- php: 5.5
env: OWNCLOUD_DATABASE=pgsql
env: NC_DATABASE=pgsql
- php: 5.6
env: OWNCLOUD_DATABASE=sqlite
env: NC_DATABASE=sqlite
- php: 5.6
env: OWNCLOUD_DATABASE=pgsql
env: NC_DATABASE=pgsql
- php: 7.0
env: OWNCLOUD_DATABASE=sqlite
env: NC_DATABASE=sqlite
- php: 7.0
env: OWNCLOUD_DATABASE=pgsql
env: NC_DATABASE=pgsql

install:
- phpenv config-add tests/travis/php.ini
- ./tests/prepare-ci-tests.sh

script:
- cd ${TRAVIS_BUILD_DIR}/../owncloud/apps/spreedme
- cd ${TRAVIS_BUILD_DIR}/../nextcloud/apps/spreedme
- phpunit -c phpunit.xml
- phpunit -c phpunit.integration.xml
34 changes: 13 additions & 21 deletions tests/prepare-ci-tests.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/bin/bash
set -eu

if [ -z "${OWNCLOUD_BRANCH:-}" ]; then
echo "No ownclound branch specified."
if [ -z "${NC_BRANCH:-}" ]; then
echo "No Nextcloud branch specified."
exit 1
fi

if [ -z "${OWNCLOUD_DATABASE:-}" ]; then
echo "No ownclound database specified."
if [ -z "${NC_DATABASE:-}" ]; then
echo "No Nextcloud database specified."
exit 1
fi

Expand Down Expand Up @@ -40,15 +40,7 @@ fi

pushd "${PROJECT_ROOT}"

echo "Installing ocdev ..."
${SUDO} ${APT_GET_INSTALL} \
python3-jinja2 \
python3-setuptools

${SUDO} easy_install3 requests==2.10.0
${SUDO} easy_install3 ocdev

case "${OWNCLOUD_DATABASE}" in
case "${NC_DATABASE}" in
pgsql)
echo "Setting up postgresql ..."
createuser -s oc_autotest
Expand All @@ -66,27 +58,27 @@ case "${OWNCLOUD_DATABASE}" in
;;

*)
echo "No additional setup required for ${OWNCLOUD_DATABASE}"
echo "No additional setup required for ${NC_DATABASE}"
;;
esac

echo "Installing owncloud ..."
echo "Installing Nextcloud ..."
cd ..
rm -rf owncloud
ocdev setup core --dir owncloud --branch "${OWNCLOUD_BRANCH}" --no-history
cp -r "${PROJECT_ROOT}" owncloud/apps/spreedme
cd owncloud/apps/spreedme
rm -rf nextcloud
git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b $NC_BRANCH nextcloud
cp -r "${PROJECT_ROOT}" nextcloud/apps/spreedme
cd nextcloud/apps/spreedme
cp config/config.php.in config/config.php
cp extra/static/config/OwnCloudConfig.js.in extra/static/config/OwnCloudConfig.js
cd ../../..
cd owncloud
cd nextcloud
./occ -vvv maintenance:install \
--database-name oc_autotest \
--database-user oc_autotest \
--database-pass \
--admin-user admin \
--admin-pass admin \
--database "${OWNCLOUD_DATABASE}"
--database "${NC_DATABASE}"

echo "Enabling spreedme app ..."
./occ app:enable spreedme
Expand Down

0 comments on commit fdc9f8b

Please sign in to comment.