This repository has been archived by the owner on Mar 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.travis.yml
79 lines (69 loc) · 3.18 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
74
75
76
77
78
79
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"
# Re-enable when trying to get CodeSniffer doesn't return a 403 anymore.
#- composer global require drupal/coder:\>7
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
# Increase max_allowed_packet to avoid MySQL errors
- echo -e "[server]\nmax_allowed_packet=64M" | sudo tee -a /etc/mysql/conf.d/drupal.cnf
- sudo service mysql restart
- phpenv rehash
script:
# Go to our Drupal module directory
- mkdir $TRAVIS_BUILD_DIR/../drupal/sites/all/modules/typed_entity
- cp -R $TRAVIS_BUILD_DIR/* $TRAVIS_BUILD_DIR/../drupal/sites/all/modules/typed_entity/
# Go to our Drupal main directory
- cd $TRAVIS_BUILD_DIR/../drupal
# Download and enable module and its dependencies
- drush --yes pm-enable registry_autoload
- drush --yes pm-enable service_container
- drush --yes dl file_entity
- drush --yes dl entity
# Enable the modules
- drush --yes pm-enable simpletest typed_entity typed_entity_example
# Patch entity to add module additional interfaces.
- cd sites/all/modules/entity
- curl -LO https://www.drupal.org/files/issues/2455851-add-additional-interfaces-1.patch
- patch -p1 < 2455851-add-additional-interfaces-1.patch
- cd $TRAVIS_BUILD_DIR/../drupal
# Run the tests
- drush test-run 'Typed Entity' --uri=http://localhost