From: gggeek Date: Fri, 20 Mar 2015 02:04:40 +0000 (+0000) Subject: Replace nginx with privoxy for travis testing X-Git-Tag: 4.0.0-alpha^2~162 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=2ec50890fc53ff0981e7a0b3ee335b10e12f08da;p=plcapi.git Replace nginx with privoxy for travis testing --- diff --git a/.travis.yml b/.travis.yml index 8f125db4..d8fbb48f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,17 +12,18 @@ before_install: - sudo apt-get update -qq install: - - composer self-update && composer install - sudo apt-get install -y apache2 libapache2-mod-fastcgi + - sudo apt-get install -y privoxy + - composer self-update && composer install before_script: # Disable xdebug. NB: this should NOT be done for hhvm... - 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. - - if [ '$TRAVIS_PHP_VERSION' != 'hhvm' ]; then ./tests/ci/travis/install_apache.sh; fi - - if [ '$TRAVIS_PHP_VERSION' = 'hhvm' ]; then ./tests/ci/travis/install_apache_hhvm.sh; fi - - ./tests/ci/travis/install_nginx.sh + - if [ '$TRAVIS_PHP_VERSION' != 'hhvm' ]; then ./tests/ci/travis/setup_apache.sh; fi + - if [ '$TRAVIS_PHP_VERSION' = 'hhvm' ]; then ./tests/ci/travis/setup_apache_hhvm.sh; fi + - ./tests/ci/travis/setup_privoxy.sh script: # to have code coverage: --coverage-clover=coverage.clover diff --git a/tests/ci/travis/install_nginx.sh b/tests/ci/travis/install_nginx.sh deleted file mode 100755 index b83f8c10..00000000 --- a/tests/ci/travis/install_nginx.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -# enable nginx (to serve as proxy) - -sudo apt-get install nginx -sudo cp -f tests/ci/travis/nginx.conf /etc/nginx/nginx.conf -sudo service nginx restart diff --git a/tests/ci/travis/nginx.conf b/tests/ci/travis/nginx.conf deleted file mode 100644 index 7b63ccf8..00000000 --- a/tests/ci/travis/nginx.conf +++ /dev/null @@ -1,21 +0,0 @@ -worker_processes 1; - -events { - worker_connections 1024; -} - -http { - #include mime.types; - #default_type application/octet-stream; - gzip on; - - server { - listen 8080; - location / { - proxy_pass http://localhost; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_redirect off; - } - } -} \ No newline at end of file diff --git a/tests/ci/travis/privoxy b/tests/ci/travis/privoxy new file mode 100644 index 00000000..67d8ff89 --- /dev/null +++ b/tests/ci/travis/privoxy @@ -0,0 +1 @@ +listen-address 127.0.0.1:8080 diff --git a/tests/ci/travis/install_apache.sh b/tests/ci/travis/setup_apache.sh old mode 100755 new mode 100644 similarity index 93% rename from tests/ci/travis/install_apache.sh rename to tests/ci/travis/setup_apache.sh index c5b0875e..e5a4c7c0 --- a/tests/ci/travis/install_apache.sh +++ b/tests/ci/travis/setup_apache.sh @@ -3,7 +3,6 @@ # 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 @@ -15,3 +14,5 @@ echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php sudo cp -f tests/ci/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 + +sudo echo "$(pwd) !!!" diff --git a/tests/ci/travis/install_apache_hhvm.sh b/tests/ci/travis/setup_apache_hhvm.sh old mode 100755 new mode 100644 similarity index 85% rename from tests/ci/travis/install_apache_hhvm.sh rename to tests/ci/travis/setup_apache_hhvm.sh index 1ff3ddd8..b604f831 --- a/tests/ci/travis/install_apache_hhvm.sh +++ b/tests/ci/travis/setup_apache_hhvm.sh @@ -3,7 +3,6 @@ # 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 @@ -12,4 +11,4 @@ hhvm -m daemon -vServer.Type=fastcgi -vServer.Port=9000 -vServer.FixPathInfo=tru # configure apache virtual hosts sudo cp -f tests/ci/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 +sudo service apache2 restart diff --git a/tests/ci/travis/setup_privoxy.sh b/tests/ci/travis/setup_privoxy.sh new file mode 100644 index 00000000..12e0e614 --- /dev/null +++ b/tests/ci/travis/setup_privoxy.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +# configure privoxy + +sudo cp -f tests/ci/travis/privoxy /etc/privoxy/config +sudo service privoxy restart