From: gggeek Date: Sun, 15 Mar 2015 23:47:28 +0000 (+0000) Subject: Yet one more try at travis+fcgi X-Git-Tag: 4.0.0-alpha^2~170 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=14800d0367e92816271d87ee4202f1db915b17bc;p=plcapi.git Yet one more try at travis+fcgi --- diff --git a/.travis.yml b/.travis.yml index 6b46ce5..da4e646 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,20 +20,8 @@ before_script: - if [ $TRAVIS_PHP_VERSION != "hhvm" -a $TRAVIS_PHP_VERSION != "7.0" ]; then phpenv config-rm xdebug.ini; fi # We set up an Apache instance inside the Travis VM and test it. - # See: http://docs.travis-ci.com/user/languages/php/#Apache-%2B-PHP - - # enable php-fpm/hhvm-fcgi - - sudo a2enmod rewrite actions fastcgi alias - - if [ $TRAVIS_PHP_VERSION != "hhvm" ]; then sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf - - echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - - if [ $TRAVIS_PHP_VERSION != "hhvm" ]; then ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm - - if [ $TRAVIS_PHP_VERSION = "hhvm" ]; then hhvm -m daemon -vServer.Type=fastcgi -vServer.Port=9000 -vServer.FixPathInfo=true - # configure apache virtual hosts - - if [ $TRAVIS_PHP_VERSION != "hhvm" ]; then sudo cp -f .travis/apache_vhost /etc/apache2/sites-available/default - - if [ $TRAVIS_PHP_VERSION = "hhvm" ]; then sudo cp -f .travis/apache_vhost_hhvm /etc/apache2/sites-available/default - - sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/default - - - sudo service apache2 restart + - sh -c "if [ '$TRAVIS_PHP_VERSION' != 'hhvm' ]; then ./.travis/install_apache.sh; fi" + - sh -c "if [ '$TRAVIS_PHP_VERSION' = 'hhvm' ]; then ./.travis/install_apache_hhvm.sh; fi" script: # to have code coverage: --coverage-clover=coverage.clover diff --git a/.travis/install_apache.sh b/.travis/install_apache.sh new file mode 100644 index 0000000..e7a5fe5 --- /dev/null +++ b/.travis/install_apache.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +# enable php-fpm +# @see https://github.com/travis-ci/travis-ci.github.com/blob/master/docs/user/languages/php.md#apache--php + +sudo apt-get install apache2 libapache2-mod-fastcgi +sudo a2enmod rewrite actions fastcgi alias + +# enable php-fpm +sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf +echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini +~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm + +# configure apache virtual hosts +sudo cp -f .travis/apache_vhost /etc/apache2/sites-available/default +sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/default +sudo service apache2 restart diff --git a/.travis/install_apache_hhvm.sh b/.travis/install_apache_hhvm.sh new file mode 100644 index 0000000..9e2869d --- /dev/null +++ b/.travis/install_apache_hhvm.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# enable hhvm-fcgi +# @see https://github.com/travis-ci/travis-ci.github.com/blob/master/docs/user/languages/php.md#apache--php + +sudo apt-get install apache2 libapache2-mod-fastcgi +sudo a2enmod rewrite actions fastcgi alias + +# start HHVM +hhvm -m daemon -vServer.Type=fastcgi -vServer.Port=9000 -vServer.FixPathInfo=true + +# configure apache virtual hosts +sudo cp -f .travis/apache_vhost_hhvm /etc/apache2/sites-available/default +sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/default +sudo service apache2 restart \ No newline at end of file