Skip to content

Commit

Permalink
Travis: before_script use here-doc for apache config
Browse files Browse the repository at this point in the history
Use bash instead of sh
  • Loading branch information
dregad committed Oct 21, 2013
1 parent b2ed27e commit 0030145
Showing 1 changed file with 18 additions and 19 deletions.
37 changes: 18 additions & 19 deletions scripts/travis_before_script.sh
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

# create database
if [ $DB = 'mysql' ]; then
Expand All @@ -14,24 +14,23 @@ if [ $TRAVIS_PHP_VERSION = '5.3' ]; then
# install Apache as PHP 5.3 does not come with an embedded web server
sudo apt-get update -qq
sudo apt-get install -qq apache2 libapache2-mod-php5 php5-mysql php5-pgsql

WEBROOT="$(pwd)"

echo "<VirtualHost *:80>
DocumentRoot $WEBROOT
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory $WEBROOT >
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>" | sudo tee /etc/apache2/sites-available/default > /dev/null


cat <<-EOF | sudo tee /etc/apache2/sites-available/default >/dev/null
<VirtualHost *:80>
DocumentRoot $PWD
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory $PWD>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
EOF

sudo service apache2 restart

# needed to allow web server to create config_inc.php
Expand Down

0 comments on commit 0030145

Please sign in to comment.