Replace nginx with privoxy for travis testing
authorgggeek <giunta.gaetano@gmail.com>
Fri, 20 Mar 2015 02:04:40 +0000 (02:04 +0000)
committergggeek <giunta.gaetano@gmail.com>
Fri, 20 Mar 2015 02:04:40 +0000 (02:04 +0000)
.travis.yml
tests/ci/travis/install_nginx.sh [deleted file]
tests/ci/travis/nginx.conf [deleted file]
tests/ci/travis/privoxy [new file with mode: 0644]
tests/ci/travis/setup_apache.sh [moved from tests/ci/travis/install_apache.sh with 93% similarity, mode: 0644]
tests/ci/travis/setup_apache_hhvm.sh [moved from tests/ci/travis/install_apache_hhvm.sh with 85% similarity, mode: 0644]
tests/ci/travis/setup_privoxy.sh [new file with mode: 0644]

index 8f125db..d8fbb48 100644 (file)
@@ -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 (executable)
index b83f8c1..0000000
+++ /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 (file)
index 7b63ccf..0000000
+++ /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 (file)
index 0000000..67d8ff8
--- /dev/null
@@ -0,0 +1 @@
+listen-address 127.0.0.1:8080
old mode 100755 (executable)
new mode 100644 (file)
similarity index 93%
rename from tests/ci/travis/install_apache.sh
rename to tests/ci/travis/setup_apache.sh
index c5b0875..e5a4c7c
@@ -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) !!!"
old mode 100755 (executable)
new mode 100644 (file)
similarity index 85%
rename from tests/ci/travis/install_apache_hhvm.sh
rename to tests/ci/travis/setup_apache_hhvm.sh
index 1ff3ddd..b604f83
@@ -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 (file)
index 0000000..12e0e61
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# configure privoxy
+
+sudo cp -f tests/ci/travis/privoxy /etc/privoxy/config
+sudo service privoxy restart