66 - 5.6
77
88env :
9- - PATH=$PATH:/home/travis/. composer/vendor/bin
9+ - PATH="$HOME/.config/ composer/vendor/bin:$PATH"
1010
1111# This will create the database
1212mysql :
@@ -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
4647before_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
5765script :
5866 # Go to our Drupal module directory
0 commit comments