before_install.sh 1016 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/bash
  2. #
  3. # SPDX-FileCopyrightText: 2015 ownCloud, Inc.
  4. # SPDX-License-Identifier: AGPL-3.0-only
  5. #
  6. # @author Thomas Müller
  7. # @copyright 2014 Thomas Müller thomas.mueller@tmit.eu
  8. #
  9. set -e
  10. WORKDIR=$PWD
  11. DB=$1
  12. echo "Work directory: $WORKDIR"
  13. echo "Database: $DB"
  14. if [ "$DB" == "mysql" ] ; then
  15. echo "Setting up mysql ..."
  16. mysql -e 'create database oc_autotest;'
  17. mysql -u root -e "CREATE USER 'oc_autotest'@'localhost' IDENTIFIED BY 'owncloud'";
  18. mysql -u root -e "grant all on oc_autotest.* to 'oc_autotest'@'localhost'";
  19. mysql -e "SELECT User FROM mysql.user;"
  20. fi
  21. if [ "$DB" == "pgsql" ] ; then
  22. createuser -U travis -s oc_autotest
  23. fi
  24. #if [ "$DB" == "oracle" ] ; then
  25. # if [ ! -f before_install_oracle.sh ]; then
  26. # wget https://raw.githubusercontent.com/owncloud/administration/master/travis-ci/before_install_oracle.sh
  27. # fi
  28. # bash ./before_install_oracle.sh
  29. #fi
  30. #
  31. # copy custom php.ini settings
  32. #
  33. if [ $(phpenv version-name) != 'hhvm' ]; then
  34. phpenv config-add tests/travis/custom.ini
  35. fi