aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2014-05-03 15:53:57 +0200
committerAndreas Fischer <bantu@phpbb.com>2014-05-03 15:53:57 +0200
commit4e529fda036b5aa3611da30277487907b83b55ac (patch)
treeaebc6f0cee3b579b19dbd0c277e49ff88526d77f
parent3b823465db93cf525249d00a412d5417b3216b83 (diff)
parentd2b783338f30b69ba31962517464df67faef3462 (diff)
downloadforums-4e529fda036b5aa3611da30277487907b83b55ac.tar
forums-4e529fda036b5aa3611da30277487907b83b55ac.tar.gz
forums-4e529fda036b5aa3611da30277487907b83b55ac.tar.bz2
forums-4e529fda036b5aa3611da30277487907b83b55ac.tar.xz
forums-4e529fda036b5aa3611da30277487907b83b55ac.zip
Merge pull request #2375 from nickvergessen/ticket/12470
Ticket/12470 Move commands from .travis.yml to separate files to allow reusing * nickvergessen/ticket/12470: [ticket/12470] Correctly set up the php extensions [ticket/12470] Fix setup of phpbb [ticket/12470] Move setup of phpBB to new .sh [ticket/12470] Move setup of database to new .sh [ticket/12470] Move phing sniff into new .sh
-rw-r--r--.travis.yml16
-rwxr-xr-xtravis/phing-sniff.sh17
-rwxr-xr-xtravis/setup-database.sh26
-rwxr-xr-xtravis/setup-phpbb.sh29
4 files changed, 75 insertions, 13 deletions
diff --git a/.travis.yml b/.travis.yml
index f1d194add7..3d79d156de 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -14,23 +14,13 @@ services:
- redis-server
install:
- - sh -c "if [ '$DB' = 'mariadb' ]; then travis/setup-mariadb.sh; fi"
- - sh -c "if [ '$TRAVIS_PHP_VERSION' != 'hhvm' ]; then travis/setup-php-extensions.sh; fi"
- - sh -c "if [ `php -r "echo (int) version_compare(PHP_VERSION, '5.3.19', '>=');"` = "1" ]; then travis/setup-webserver.sh; fi"
- - cd phpBB
- - php ../composer.phar install --dev --no-interaction --prefer-source
- - cd ..
+ - travis/setup-phpbb.sh $DB $TRAVIS_PHP_VERSION
before_script:
- - sh -c "if [ '$DB' = 'postgres' ]; then psql -c 'DROP DATABASE IF EXISTS phpbb_tests;' -U postgres; fi"
- - sh -c "if [ '$DB' = 'postgres' ]; then psql -c 'create database phpbb_tests;' -U postgres; fi"
- - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.3' -a '$DB' = 'mysql' ]; then mysql -e 'SET GLOBAL storage_engine=MyISAM;'; fi"
- - sh -c "if [ '$DB' = 'mysql' -o '$DB' = 'mariadb' ]; then mysql -e 'create database IF NOT EXISTS phpbb_tests;'; fi"
+ - travis/setup-database.sh $DB $TRAVIS_PHP_VERSION
script:
- - cd build
- - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.5' -a '$DB' = 'mysql' ]; then ../phpBB/vendor/bin/phing sniff; fi"
- - cd ..
+ - travis/phing-sniff.sh $DB $TRAVIS_PHP_VERSION
- phpBB/vendor/bin/phpunit --configuration travis/phpunit-$DB-travis.xml
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.5' -a '$DB' = 'mysql' -a '$TRAVIS_PULL_REQUEST' != 'false' ]; then git-tools/commit-msg-hook-range.sh origin/$TRAVIS_BRANCH..FETCH_HEAD; fi"
diff --git a/travis/phing-sniff.sh b/travis/phing-sniff.sh
new file mode 100755
index 0000000000..1473b99da4
--- /dev/null
+++ b/travis/phing-sniff.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+#
+# @copyright (c) 2014 phpBB Group
+# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+#
+set -e
+set -x
+
+DB=$1
+TRAVIS_PHP_VERSION=$2
+
+if [ "$TRAVIS_PHP_VERSION" == "5.5" -a "$DB" == "mysql" ]
+then
+ cd build
+ ../phpBB/vendor/bin/phing sniff
+ cd ..
+fi
diff --git a/travis/setup-database.sh b/travis/setup-database.sh
new file mode 100755
index 0000000000..c1917042cd
--- /dev/null
+++ b/travis/setup-database.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+#
+# @copyright (c) 2014 phpBB Group
+# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+#
+set -e
+set -x
+
+DB=$1
+TRAVIS_PHP_VERSION=$2
+
+if [ "$DB" == "postgres" ]
+then
+ psql -c 'DROP DATABASE IF EXISTS phpbb_tests;' -U postgres
+ psql -c 'create database phpbb_tests;' -U postgres
+fi
+
+if [ "$TRAVIS_PHP_VERSION" == "5.3" -a "$DB" == "mysql" ]
+then
+ mysql -e 'SET GLOBAL storage_engine=MyISAM;'
+fi
+
+if [ "$DB" == "mysql" -o "$DB" == "mariadb" ]
+then
+ mysql -e 'create database IF NOT EXISTS phpbb_tests;'
+fi
diff --git a/travis/setup-phpbb.sh b/travis/setup-phpbb.sh
new file mode 100755
index 0000000000..f079a0a6b7
--- /dev/null
+++ b/travis/setup-phpbb.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+#
+# @copyright (c) 2014 phpBB Group
+# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+#
+set -e
+set -x
+
+DB=$1
+TRAVIS_PHP_VERSION=$2
+
+if [ "$DB" == "mariadb" ]
+then
+ travis/setup-mariadb.sh
+fi
+
+if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]
+then
+ travis/setup-php-extensions.sh
+fi
+
+if [ `php -r "echo (int) version_compare(PHP_VERSION, '5.3.19', '>=');"` == "1" ]
+then
+ travis/setup-webserver.sh
+fi
+
+cd phpBB
+php ../composer.phar install --dev --no-interaction --prefer-source
+cd ..