-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
73 lines (66 loc) · 2.95 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
language: php
php:
- 5.4
env:
- PATH=$PATH:/home/travis/.composer/vendor/bin
# This will create the database
mysql:
database: drupal
username: root
encoding: utf8
install:
# Grab Drush
- pear channel-discover pear.drush.org
- pear install drush/drush-5.8.0
- phpenv rehash
# Make sure we don't fail when checking out projects
- echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
# LAMP package installation (mysql is already started)
- sudo apt-get update
- sudo apt-get install apache2 libapache2-mod-fastcgi
# enable php-fpm, travis does not support any other method with php and apache
- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
- sudo a2enmod rewrite actions fastcgi alias
- echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
# Make sure the apache root is in our wanted directory
- 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
# Set sendmail so drush doesn't throw an error during site install.
- echo "sendmail_path='true'" >> `php --ini | grep "Loaded Configuration" | awk '{print $4}'`
# Forward the errors to the syslog so we can print them
- echo "error_log=syslog" >> `php --ini | grep "Loaded Configuration" | awk '{print $4}'`
# Get latest drupal 8 core
- cd $TRAVIS_BUILD_DIR/..
- git clone --depth 1 --branch 7.x http://git.drupal.org/project/drupal.git
# Restart apache and test it
- sudo service apache2 restart
- curl -v "http://localhost"
before_script:
- cd $TRAVIS_BUILD_DIR/../drupal
# Update drupal core
- git pull origin 7.x
# Install the site
- drush -v site-install minimal --db-url=mysql://root:@localhost/drupal --yes
- drush en --yes simpletest
- phpenv rehash
# Set variable to 0 to avoid automatic composer build
- drush vset composer_manager_autobuild_packages 0 -y
# Increase nmax_allowed_packet to avoid MySQL errors
- echo -e "[server]\nmax_allowed_packet=64M" | sudo tee -a /etc/mysql/conf.d/my.cnf
- sudo service mysql restart
script:
# Go to our Drupal module directory
- mkdir $TRAVIS_BUILD_DIR/../drupal/sites/all/modules/plug_config
- cp -R $TRAVIS_BUILD_DIR/* $TRAVIS_BUILD_DIR/../drupal/sites/all/modules/plug_config/
# Go to our Drupal main directory
- cd $TRAVIS_BUILD_DIR/../drupal
# Download and enable modules
- drush --yes dl xautoload
- drush --yes dl composer-8.x-1.x
- drush --yes dl composer_manager
- drush --yes dl plug
- drush --yes pm-enable plug
- drush --yes composer-manager update --no-interaction --prefer-source
- drush --yes pm-enable plug_config_example
# Run module tests
- drush test-run "Plug Config" --uri=http://localhost