Skip to content

Commit

Permalink
Updated TravisCI
Browse files Browse the repository at this point in the history
  • Loading branch information
kjdev committed Jul 31, 2017
1 parent 9ef3cc4 commit 122e3c4
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 15 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
language: c

sudo: required
dist: trusty

matrix:
include:
Expand Down
16 changes: 11 additions & 5 deletions .travis/before_install.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
#!/bin/bash

sudo apt-get update -qq

if [ "${APACHE_VERSION}" = "2.4.x" ]; then
sudo apt-get install -qq software-properties-common python-software-properties
sudo apt-add-repository -y ppa:ondrej/apache2
sudo apt-get update -qq
sudo apt-get install -qq apache2 apache2-dev
else
sudo tee -a /etc/apt/sources.list <<EOF
deb http://archive.ubuntu.com/ubuntu precise main restricted universe
deb http://archive.ubuntu.com/ubuntu precise-updates main restricted universe
deb http://security.ubuntu.com/ubuntu precise-security main restricted universe multiverse
EOF
sudo apt-get update -qq
apache2_version=$(apt-cache showpkg apache2 | grep 'Reverse Provides:' -C 1 | tail -1 | awk '{print $2}')
sudo apt-get install -qq --force-yes apache2-mpm-prefork=${apache2_version} apache2-prefork-dev=${apache2_version} apache2.2-bin=${apache2_version} apache2.2-common=${apache2_version}
fi

sudo apt-get install -qq apache2 apache2-dev automake libtool autotools-dev make curl
sudo apt-get install -qq automake libtool autotools-dev make curl
12 changes: 7 additions & 5 deletions .travis/before_script.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#!/bin/bash

if [ "${APACHE_VERSION}" = "2.4.x" ]; then
conf=/etc/apache2/sites-available/000-default.conf
sudo cp -f "${TRAVIS_BUILD_DIR}/tests/conf/test.conf" ${conf}
default=/etc/apache2/sites-enabled/000-default.conf
conf=${TRAVIS_BUILD_DIR}/tests/conf/test.2.4.conf
else
conf=/etc/apache2/sites-available/default
sudo bash -c "cat ${TRAVIS_BUILD_DIR}/tests/conf/test.conf | sed -e 's%#\([Allow|Order]\)%\1%gi' -e 's%\(Require\)%#\1%g' > ${conf}"
default=/etc/apache2/sites-enabled/000-default
conf=${TRAVIS_BUILD_DIR}/tests/conf/test.2.2.conf
fi
sudo cp -f ${conf} ${default}

sudo sed -e "s|/var/www/html|${TRAVIS_BUILD_DIR}/tests/html|g" --in-place ${conf}
sudo mkdir -p /var/www/html/
sudo cp -R ${TRAVIS_BUILD_DIR}/tests/html/* /var/www/html/

sudo service apache2 restart

Expand Down
23 changes: 23 additions & 0 deletions tests/conf/test.2.2.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# LoadModule brotli_module modules/mod_brotli.so
LogLevel debug
ErrorLog "/var/log/apache2/brotli.log"

<VirtualHost *:80>
DocumentRoot /var/www/html
<Directory /var/www/html>
Options FollowSymLinks
AllowOverride None
Order allow,deny
allow from all
</Directory>

<Directory /var/www/html/br1>
AddOutputFilterByType BROTLI text/html
</Directory>

<Directory /var/www/html/br2>
SetOutputFilter BROTLI
SetEnvIfNoCase Request_URI \.htm$ no-br
</Directory>

</VirtualHost>
9 changes: 4 additions & 5 deletions tests/conf/test.conf → tests/conf/test.2.4.conf
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# LoadModule brotli_module modules/mod_brotli.so
LogLevel debug
ErrorLog "/var/log/apache2/brotli.log"

<VirtualHost *:80>
DocumentRoot /var/www/html
<Directory /var/www/html>
Options FollowSymLinks
## 2.2
#AllowOverride None
#Order allow,deny
#allow from all
## 2.4
Require all granted
</Directory>

Expand Down
1 change: 1 addition & 0 deletions tests/html/br1/test01.txt

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions tests/html/br1/test02.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions tests/html/br2/test03.txt

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions tests/html/br2/test04.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions tests/html/br2/test05.htm

Large diffs are not rendered by default.

0 comments on commit 122e3c4

Please sign in to comment.