aboutsummaryrefslogtreecommitdiffstats
path: root/travis
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-03-31 20:53:55 +0200
committerJoas Schilling <nickvergessen@gmx.de>2014-03-31 20:53:55 +0200
commitc2fbaf3af2aef5311952c653a3844550b06d53ad (patch)
tree9a2c376ef90412b3a21a7a7f55ad9f3ed5a886f9 /travis
parentdc3cb2205bf61428e9f1e6c6318366203e5c316f (diff)
parent297729aa324710f9547fb5dc7a8bbcdf85049d21 (diff)
downloadforums-c2fbaf3af2aef5311952c653a3844550b06d53ad.tar
forums-c2fbaf3af2aef5311952c653a3844550b06d53ad.tar.gz
forums-c2fbaf3af2aef5311952c653a3844550b06d53ad.tar.bz2
forums-c2fbaf3af2aef5311952c653a3844550b06d53ad.tar.xz
forums-c2fbaf3af2aef5311952c653a3844550b06d53ad.zip
Merge remote-tracking branch 'bantu/ticket/12318-olympus' into develop-olympus
* bantu/ticket/12318-olympus: [ticket/12318] Use MySQL instead of MySQLi for now on HHVM. [ticket/12318] Pin HHVM version to 3.0.0~precise. [ticket/12318] Always install new config file on HHVM upgrade conflict. [ticket/12318] Add PPA providing dependencies for recent HHVM on Ubuntu 12.04. [ticket/12318] Upgrade to a recent stable version of HHVM. [ticket/12318] Correctly setup HHVM for functional tests.
Diffstat (limited to 'travis')
-rwxr-xr-xtravis/setup-webserver.sh83
1 files changed, 54 insertions, 29 deletions
diff --git a/travis/setup-webserver.sh b/travis/setup-webserver.sh
index f1bf69c575..9802fab749 100755
--- a/travis/setup-webserver.sh
+++ b/travis/setup-webserver.sh
@@ -1,55 +1,80 @@
#!/bin/bash
#
-# @copyright (c) 2013 phpBB Group
+# @copyright (c) 2014 phpBB Group
# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
#
set -e
set -x
+if [ "$TRAVIS_PHP_VERSION" = 'hhvm' ]
+then
+ # Add PPA providing dependencies for recent HHVM on Ubuntu 12.04.
+ sudo add-apt-repository -y ppa:mapnik/boost
+fi
+
sudo apt-get update
sudo apt-get install -y nginx realpath
sudo service nginx stop
DIR=$(dirname "$0")
+USER=$(whoami)
PHPBB_ROOT_PATH=$(realpath "$DIR/../phpBB")
-
NGINX_CONF="/etc/nginx/sites-enabled/default"
+APP_SOCK=$(realpath "$DIR")/php-app.sock
-PHP_FPM_BIN="$HOME/.phpenv/versions/$TRAVIS_PHP_VERSION/sbin/php-fpm"
-PHP_FPM_CONF="$DIR/php-fpm.conf"
-PHP_FPM_SOCK=$(realpath "$DIR")/php-fpm.sock
+if [ "$TRAVIS_PHP_VERSION" = 'hhvm' ]
+then
+ # Upgrade to a recent stable version of HHVM
+ sudo apt-get -o Dpkg::Options::="--force-confnew" \
+ install -y hhvm=3.0.0~precise
-USER=$(whoami)
+ # MySQLi is broken in HHVM 3.0.0~precise and still does not work for us in
+ # 2014.03.28~saucy, i.e. needs more work. Use MySQL extension for now.
+ sed -i "s/mysqli/mysql/" "$DIR/phpunit-mysql-travis.xml"
-# php-fpm configuration
-echo "
-[global]
+ HHVM_LOG=$(realpath "$DIR")/hhvm.log
-[travis]
-user = $USER
-group = $USER
-listen = $PHP_FPM_SOCK
-pm = static
-pm.max_children = 2
+ sudo hhvm \
+ --mode daemon \
+ --user "$USER" \
+ -vServer.Type=fastcgi \
+ -vServer.FileSocket="$APP_SOCK" \
+ -vLog.File="$HHVM_LOG"
+else
+ # php-fpm
+ PHP_FPM_BIN="$HOME/.phpenv/versions/$TRAVIS_PHP_VERSION/sbin/php-fpm"
+ PHP_FPM_CONF="$DIR/php-fpm.conf"
-php_admin_value[memory_limit] = 128M
-" > $PHP_FPM_CONF
+ echo "
+ [global]
-# nginx configuration
+ [travis]
+ user = $USER
+ group = $USER
+ listen = $APP_SOCK
+ pm = static
+ pm.max_children = 2
+
+ php_admin_value[memory_limit] = 128M
+ " > $PHP_FPM_CONF
+
+ sudo $PHP_FPM_BIN \
+ --fpm-config "$DIR/php-fpm.conf"
+fi
+
+# nginx
echo "
-server {
- listen 80;
- root $PHPBB_ROOT_PATH/;
- index index.php index.html;
-
- location ~ \.php {
- fastcgi_pass unix:$PHP_FPM_SOCK;
- include fastcgi_params;
+ server {
+ listen 80;
+ root $PHPBB_ROOT_PATH/;
+ index index.php index.html;
+
+ location ~ \.php {
+ fastcgi_pass unix:$APP_SOCK;
+ include fastcgi_params;
+ }
}
-}
" | sudo tee $NGINX_CONF > /dev/null
-# Start daemons
-sudo $PHP_FPM_BIN --fpm-config "$DIR/php-fpm.conf"
sudo service nginx start