Skip to content

Commit afc5ed0

Browse files
author
Itamar Shapira Bar-Lev
committed
Merge remote-tracking branch 'upstream/7.x-1.x' into extendable-restful-authentication-token
2 parents 5e1bd95 + e1f00c3 commit afc5ed0

File tree

2 files changed

+44
-11
lines changed

2 files changed

+44
-11
lines changed

.travis-apache.cfg

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<VirtualHost *:80>
2+
# [...]
3+
4+
DocumentRoot PATH
5+
6+
<Directory "PATH">
7+
Options FollowSymLinks MultiViews ExecCGI
8+
AllowOverride All
9+
Require all granted
10+
</Directory>
11+
12+
# Wire up Apache to use Travis CI's php-fpm.
13+
<IfModule mod_fastcgi.c>
14+
AddHandler php5-fcgi .php
15+
Action php5-fcgi /php5-fcgi
16+
Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
17+
FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9000 -pass-header Authorization
18+
19+
<Directory /usr/lib/cgi-bin>
20+
Require all granted
21+
</Directory>
22+
</IfModule>
23+
24+
# [...]
25+
</VirtualHost>

.travis.yml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ php:
66
- 5.6
77

88
env:
9-
- PATH=$PATH:/home/travis/.composer/vendor/bin
9+
- PATH="$HOME/.config/composer/vendor/bin:$PATH"
1010

1111
# This will create the database
1212
mysql:
@@ -21,38 +21,46 @@ install:
2121
# Make sure we don't fail when checking out projects
2222
- echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
2323
# LAMP package installation (mysql is already started)
24-
- sudo apt-get update
2524
- sudo apt-get install apache2 libapache2-mod-fastcgi
2625
# enable php-fpm, travis does not support any other method with php and apache
2726
- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
2827
- sudo a2enmod rewrite actions fastcgi alias
2928
- echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
29+
- sudo sed -i -e "s,www-data,travis,g" /etc/apache2/envvars
30+
- sudo chown -R travis:travis /var/lib/apache2/fastcgi
3031
- ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
31-
# Make sure the apache root is in our wanted directory
32-
- echo "$(curl -fsSL https://gist.githubusercontent.com/nickveenhof/11386315/raw/b8abaf9304fe12b5cc7752d39c29c1edae8ac2e6/gistfile1.txt)" | sed -e "s,PATH,$TRAVIS_BUILD_DIR/../drupal,g" | sudo tee /etc/apache2/sites-available/default > /dev/null
3332
# Set sendmail so drush doesn't throw an error during site install.
3433
- echo "sendmail_path='true'" >> `php --ini | grep "Loaded Configuration" | awk '{print $4}'`
3534
# Forward the errors to the syslog so we can print them
3635
- echo "error_log=syslog" >> `php --ini | grep "Loaded Configuration" | awk '{print $4}'`
3736
# Get latest drupal 8 core
3837
- cd $TRAVIS_BUILD_DIR/..
3938
- git clone --depth 1 --branch 7.x http://git.drupal.org/project/drupal.git
40-
# Restart apache and test it
41-
- sudo service apache2 restart
42-
- curl -v "http://localhost"
39+
# Make sure the apache root is in our wanted directory
40+
- cd drupal && export DOCROOT=$(pwd)
41+
- export APACHE_SITE_CFG="/etc/apache2/sites-available/000-default.conf"
42+
- sudo sh -c 'cat $TRAVIS_BUILD_DIR/.travis-apache.cfg | sed -e "s,PATH,$DOCROOT,g" | tee > $APACHE_SITE_CFG'
43+
4344
# Re-enable when trying to get CodeSniffer doesn't return a 403 anymore.
4445
#- composer global require drupal/coder:\>7
4546

4647
before_script:
4748
- cd $TRAVIS_BUILD_DIR/../drupal
48-
# Update drupal core
49-
- git pull origin 7.x
5049
# Install the site
5150
- drush -v site-install minimal --db-url=mysql://root:@localhost/drupal --yes
51+
- phpenv rehash
52+
- echo " > MySQL fine-tuning."
53+
- sudo service mysql stop
5254
# Increase max_allowed_packet to avoid MySQL errors
5355
- echo -e "[server]\nmax_allowed_packet=64M" | sudo tee -a /etc/mysql/conf.d/drupal.cnf
54-
- sudo service mysql restart
55-
- phpenv rehash
56+
# Performance optimization - MySQL to RAM disk
57+
- sudo mv /var/lib/mysql /var/run/tmpfs
58+
- sudo ln -s /var/run/tmpfs /var/lib/mysql
59+
- sudo service mysql start
60+
61+
# Restart apache and test it
62+
- sudo service apache2 restart
63+
- curl -v "http://localhost"
5664

5765
script:
5866
# Go to our Drupal module directory

0 commit comments

Comments
 (0)