aboutsummaryrefslogtreecommitdiffstats
path: root/travis
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2014-03-29 11:52:37 +0100
committerAndreas Fischer <bantu@phpbb.com>2014-03-30 15:43:54 +0200
commit04707cbf8dda006bbc3dcd892e61b2b6f96fda97 (patch)
tree842344b345e06d7b9530b5e974779a005e9142f0 /travis
parentdc3cb2205bf61428e9f1e6c6318366203e5c316f (diff)
downloadforums-04707cbf8dda006bbc3dcd892e61b2b6f96fda97.tar
forums-04707cbf8dda006bbc3dcd892e61b2b6f96fda97.tar.gz
forums-04707cbf8dda006bbc3dcd892e61b2b6f96fda97.tar.bz2
forums-04707cbf8dda006bbc3dcd892e61b2b6f96fda97.tar.xz
forums-04707cbf8dda006bbc3dcd892e61b2b6f96fda97.zip
[ticket/12318] Correctly setup HHVM for functional tests.
PHPBB3-12318
Diffstat (limited to 'travis')
-rwxr-xr-xtravis/setup-webserver.sh69
1 files changed, 40 insertions, 29 deletions
diff --git a/travis/setup-webserver.sh b/travis/setup-webserver.sh
index f1bf69c575..d9c6b370a1 100755
--- a/travis/setup-webserver.sh
+++ b/travis/setup-webserver.sh
@@ -1,6 +1,6 @@
#!/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
@@ -12,44 +12,55 @@ 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
+ HHVM_LOG=$(realpath "$DIR")/hhvm.log
-USER=$(whoami)
+ 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-fpm configuration
-echo "
-[global]
+ echo "
+ [global]
+
+ [travis]
+ user = $USER
+ group = $USER
+ listen = $APP_SOCK
+ pm = static
+ pm.max_children = 2
-[travis]
-user = $USER
-group = $USER
-listen = $PHP_FPM_SOCK
-pm = static
-pm.max_children = 2
+ php_admin_value[memory_limit] = 128M
+ " > $PHP_FPM_CONF
-php_admin_value[memory_limit] = 128M
-" > $PHP_FPM_CONF
+ sudo $PHP_FPM_BIN \
+ --fpm-config "$DIR/php-fpm.conf"
+fi
-# nginx configuration
+# 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