-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
92 lines (69 loc) · 2.7 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
80
81
82
83
84
85
86
87
88
89
90
91
92
# Sudo not allowed in the new Travis architecture which is based on containers.
# @see http://docs.travis-ci.com/user/migrating-from-legacy/
sudo: false
addons:
apt:
packages:
- php5-cgi
- php5-cgi
- php5-curl
- php5-gd
- php5-mysql
language: php
php:
- 7.0
mysql:
database: drupal
username: root
encoding: utf8
#branches:
# only:
# - develop
before_install:
- composer self-update
install:
# Creates DB
- "mysql -e 'create database drupal;'"
# Adds composer's global bin directory to the path.
# See: https://github.com/drush-ops/drush#install---composer
- export PATH="$HOME/.composer/vendor/bin:$PATH"
# Sets Behat parameters.
- export BEHAT_PARAMS='{"extensions":{"Behat\\MinkExtension":{"base_url":"http://127.0.0.1:8080"},"Drupal\\DrupalExtension":{"drupal":{"drupal_root":"/home/travis/build/jeffymahoney/loopduplicate.com/docroot"},"drush":{"alias":"self"},"subcontexts":{"paths":["/home/travis/build/jeffymahoney/loopduplicate.com/docroot/sites/all"]}}}}'
# Installs drush.
- composer global require drush/drush:6.*
- phpenv rehash
# Copies over settings.php
- cp $TRAVIS_BUILD_DIR/docroot/sites/default/travis.settings.php $TRAVIS_BUILD_DIR/docroot/sites/default/settings.php
# Installs additional libraries via composer.
- cd $TRAVIS_BUILD_DIR
- composer install --prefer-source
before_script:
# Copy drush alias.
- mkdir ~/.drush
- cp $TRAVIS_BUILD_DIR/aliases.drushrc.php ~/.drush/
# Builds Behat dependencies.
- cd $TRAVIS_BUILD_DIR/docroot/sites/default/tests/behat
- composer install --prefer-source
# Sets sendmail so drush doesn't throw an error during site install.
- echo "sendmail_path='true'" >> `php --ini | grep "Loaded Configuration" | awk '{print $4}'`
# Installs site.
- cd $TRAVIS_BUILD_DIR/docroot
- drush si loopd_profile --db-url=mysql://travis:@127.0.0.1/drupal --site-name=LoopDuplicate --account-mail="[email protected]" --account-name=loopduplicate --account-pass=loopduplicate --site-mail="[email protected]" -y;
# Starts a web server on port 8080 which runs in the background.
- drush @self runserver 127.0.0.1:8080 &
# Waits for initialization.
# The commented line below worked on the old Travis architecture but it seems
# to hang on the new container based architecture. Using sleep instead.
# - until netstat -an 2>/dev/null | grep '8080.*LISTEN'; do true; done
- sleep 10
script:
# Runs PhantomJs.
- phantomjs --webdriver=8643 > ~/phantomjs.log 2>&1 &
# Runs Behat Tests.
- cd $TRAVIS_BUILD_DIR/docroot/sites/default/tests/behat
- ./bin/behat
# Runs PHPUnit Tests.
- cd $TRAVIS_BUILD_DIR
- vendor/bin/phpunit -c phpunit.xml
# Prints logs.
- cat ~/phantomjs.log