From acf95247108c456b14bb95483a449f2ee7bd72b9 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 2 May 2014 16:32:00 +0200 Subject: [PATCH 1/5] [ticket/12470] Move phing sniff into new .sh PHPBB3-12470 --- .travis.yml | 4 +--- travis/phing-sniff.sh | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) create mode 100755 travis/phing-sniff.sh diff --git a/.travis.yml b/.travis.yml index f1d194add7..d8d931ae12 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,9 +28,7 @@ before_script: - sh -c "if [ '$DB' = 'mysql' -o '$DB' = 'mariadb' ]; then mysql -e 'create database IF NOT EXISTS phpbb_tests;'; fi" script: - - cd build - - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.5' -a '$DB' = 'mysql' ]; then ../phpBB/vendor/bin/phing sniff; fi" - - cd .. + - travis/phing-code-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 From 5cef3254f71f2b0f06c98a4b18a5fc2a23bbac7b Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 2 May 2014 16:34:01 +0200 Subject: [PATCH 2/5] [ticket/12470] Move setup of database to new .sh PHPBB3-12470 --- .travis.yml | 5 +---- travis/setup-database.sh | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 4 deletions(-) create mode 100755 travis/setup-database.sh diff --git a/.travis.yml b/.travis.yml index d8d931ae12..2e6e6d20fe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,10 +22,7 @@ install: - cd .. 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: - travis/phing-code-sniff.sh $DB $TRAVIS_PHP_VERSION 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 From a2ac425688fdd6f5b6bd9c51a24d1a9c261e2033 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 2 May 2014 16:37:00 +0200 Subject: [PATCH 3/5] [ticket/12470] Move setup of phpBB to new .sh PHPBB3-12470 --- .travis.yml | 7 +------ travis/setup-phpbb.sh | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 6 deletions(-) create mode 100755 travis/setup-phpbb.sh diff --git a/.travis.yml b/.travis.yml index 2e6e6d20fe..051e25aa08 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,12 +14,7 @@ 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/install-setup-phpbb.sh $DB $TRAVIS_PHP_VERSION before_script: - travis/setup-database.sh $DB $TRAVIS_PHP_VERSION diff --git a/travis/setup-phpbb.sh b/travis/setup-phpbb.sh new file mode 100755 index 0000000000..8a8bde373c --- /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 .. From 994ab684bcd0de29aa9e31775631f1022660bf4d Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 2 May 2014 19:29:30 +0200 Subject: [PATCH 4/5] [ticket/12470] Fix setup of phpbb PHPBB3-12470 --- .travis.yml | 4 ++-- travis/setup-phpbb.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 051e25aa08..3d79d156de 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,13 +14,13 @@ services: - redis-server install: - - travis/install-setup-phpbb.sh $DB $TRAVIS_PHP_VERSION + - travis/setup-phpbb.sh $DB $TRAVIS_PHP_VERSION before_script: - travis/setup-database.sh $DB $TRAVIS_PHP_VERSION script: - - travis/phing-code-sniff.sh $DB $TRAVIS_PHP_VERSION + - 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/setup-phpbb.sh b/travis/setup-phpbb.sh index 8a8bde373c..74be5367e5 100755 --- a/travis/setup-phpbb.sh +++ b/travis/setup-phpbb.sh @@ -16,7 +16,7 @@ fi if [ "$TRAVIS_PHP_VERSION" == "hhvm" ] then - travis/setup-php-extensions.sh + stravis/setup-php-extensions.sh fi if [ `php -r "echo (int) version_compare(PHP_VERSION, '5.3.19', '>=');"` == "1" ] From d2b783338f30b69ba31962517464df67faef3462 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sat, 3 May 2014 01:18:55 +0200 Subject: [PATCH 5/5] [ticket/12470] Correctly set up the php extensions PHPBB3-12470 --- travis/setup-phpbb.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/travis/setup-phpbb.sh b/travis/setup-phpbb.sh index 74be5367e5..f079a0a6b7 100755 --- a/travis/setup-phpbb.sh +++ b/travis/setup-phpbb.sh @@ -14,9 +14,9 @@ then travis/setup-mariadb.sh fi -if [ "$TRAVIS_PHP_VERSION" == "hhvm" ] +if [ "$TRAVIS_PHP_VERSION" != "hhvm" ] then - stravis/setup-php-extensions.sh + travis/setup-php-extensions.sh fi if [ `php -r "echo (int) version_compare(PHP_VERSION, '5.3.19', '>=');"` == "1" ]