-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
107 lines (83 loc) · 3.46 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
language: php
php:
- 5.5
#sudo: false
env:
global:
- SAUCE_USERNAME="ucsfdrupal"
- SAUCE_ACCESS_KEY="ff0f8d29-743a-49eb-a625-89c923877bbf"
matrix:
- BEHAT_PROFILE='default'
# - BEHAT_PROFILE='winxpie7'
# - BEHAT_PROFILE='win7ie8'
# - BEHAT_PROFILE='win7ie9'
# - BEHAT_PROFILE='win7ie10'
- BEHAT_PROFILE='win8ie11'
- BEHAT_PROFILE='osxchrome'
# - BEHAT_PROFILE='osxsafari'
# safari driver is faulty, mouseMoveTo is not supported.
# https://code.google.com/p/selenium/issues/detail?id=4136
matrix:
fast_finish: true
mysql:
username: root
encoding: utf8
before_install:
- composer self-update
- sudo apt-get update -qq
install:
# install php packages required for running a web server from drush on php 5.4
- sudo apt-get install -y --force-yes php5-cgi php5-mysql
# install apache
- sudo apt-get install apache2 libapache2-mod-fastcgi
# add composer's global bin directory to the path
# see: https://github.com/drush-ops/drush#install---composer
- sed -i '1i export PATH="$HOME/.composer/vendor/bin:$PATH"' $HOME/.bashrc
- source $HOME/.bashrc
# install drush globally
- composer global require drush/drush:6.*
# install behat and co
- composer install -d tests/behat
before_script:
# enable php-fpm
- 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
# create a new database
- mysql -e 'CREATE DATABASE starterkit'
# start Sauce Connect
- ${TRAVIS_BUILD_DIR}/tests/behat/bin/sauce_connect --readyfile /tmp/scready.tmp --tunnel-identifier $TRAVIS_JOB_NUMBER $SAUCE_USERNAME $SAUCE_ACCESS_KEY > /dev/null &
- while [ ! -f /tmp/scready.tmp ]; do(sleep .5) done
script:
# build drupal and the profile into the webroot dir
- drush make --prepare-install make/build-ucsf_installprofile-ci.make webroot
# build modules/themes/libs into a temp dir
- drush make --no-cache --contrib-destination="." --no-core make/drupal-org.make tmp
# move the temp directory's content into sites/all
- cp -r tmp/* webroot/sites/all/
# delete temp dir
- rm -rf tmp
# move the webroot out of the profile to prevent path clobbering
- mv webroot $TRAVIS_BUILD_DIR/../webroot
- cd $TRAVIS_BUILD_DIR/../webroot
# copy the profile to the profiles/ directory, then remove tests and build/make subdirs
- cp -R $TRAVIS_BUILD_DIR profiles/ucsf_installprofile
- rm -rf profiles/ucsf_installprofile/build
- rm -rf profiles/ucsf_installprofile/make
- rm -rf profiles/ucsf_installprofile/tests
# configure apache virtual hosts
- sudo cp -f $TRAVIS_BUILD_DIR/build/travis-ci-apache /etc/apache2/sites-available/default
- sudo sed -e "s?%DOCROOT%?$(pwd)?g" --in-place /etc/apache2/sites-available/default
# configure behat
- sudo sed -e "s?%DOCROOT%?$(pwd)?g" --in-place ${TRAVIS_BUILD_DIR}/tests/behat/behatci.yml
# restart apache
- sudo service apache2 restart
- until netstat -an 2>/dev/null | grep '80.*LISTEN'; do true; done
# create new site, stubbing sendmail path with true to prevent delivery errors and manually
- php -d sendmail_path=`which true` ~/.composer/vendor/bin/drush.php --yes site-install ucsf_installprofile --db-url=mysql://root:@127.0.0.1/starterkit
# disable dblog
- drush pm-disable dblog --yes
- drush cc all
# run behat tests
- ${TRAVIS_BUILD_DIR}/tests/behat/bin/behat -c ${TRAVIS_BUILD_DIR}/tests/behat/behatci.yml -p ${BEHAT_PROFILE}