-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
83 lines (82 loc) · 4.5 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
env:
#global environmental variables control magento instal parameters
#see also hosts in addons.
global:
- FASTGENTO_MAGE2_FAKE_URL=http://magento-2-travis.dev
- FASTGENTO_MAGE2_ADMIN_FIRST_NAME=Robert
- FASTGENTO_MAGE2_ADMIN_LAST_NAME=Hoffner
- FASTGENTO_MAGE2_ADMIN_USERNAME=admin
- FASTGENTO_MAGE2_ADMIN_PASSWORD=ih3artmagento
- FASTGENTO_MAGE2_ADMIN_DBNAME=magento_2_travis
- FASTGENTO_SITE_URL=http://fastgento.com
- [email protected]:ant-workaholic/Store-locator.git
- FASTGENTO_COMPOSER_PACKAGE_TO_TEST=fastgento/storelocator
addons:
hosts:
# should match PULSESTORM_MAGE2_FAKE_URL above
- magento-2-travis.dev
language: php
sudo: required
dist: trusty
php:
- 5.6
- 7.0
before_script:
# some useful debugging stuff for travis
#- curl http://magento-2-travis.dev/index.php
#- curl http://magento-2-travis.dev/
#- sudo find /var/log/apache2 -exec cat '{}' \;
#- sudo cat /etc/apache2/sites-available/000-default.conf
#- sudo cat /etc/apache2/sites-enabled/000-default.conf
#- sudo apachectl -V
#- sudo apache2ctl -V
#- ls -lh $TRAVIS_BUILD_DIR
#- sudo ls /etc/apache2/sites-available
#- sudo ls /etc/apache2/sites-enabled
#- pwd
#
# get latest composer
- composer selfupdate
# disable xdebug for perf
- echo '' > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini
# add multiverse support to get MySQL 5.6 update apt
- sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ trusty multiverse" && sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ trusty-updates multiverse"
- sudo apt-get update -qq
# add mysql 5.6
- sudo apt-get remove -y -qq --purge mysql-common mysql-server-5.5 mysql-server-core-5.5 mysql-client-5.5 mysql-client-core-5.5
- sudo apt-get -y -qq autoremove;
- sudo apt-get -y -qq autoclean;
- sudo apt-get install -y -qq mysql-server-5.6 mysql-client-5.6;
- mysql -uroot -e 'SET @@global.sql_mode = NO_ENGINE_SUBSTITUTION; CREATE DATABASE magento_2_travis;';
# add apache
- sudo apt-get install -y -qq apache2 libapache2-mod-fastcgi
# enable php-fpm -- www.conf.default is PHP 7 only, so we dev/null any copy problems
- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf 2>/dev/null || true
- 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
# awful hack used during travis debugging that I swear I'm going to remove
# but then again you're reading this so I didn't remove it and **sigh**
- sudo chmod 777 /home /home/travis /home/travis/build
# configure apache virtual hosts, assumes 000-default.conf is there
- sudo cp -f .travis/travis-ci-apache /etc/apache2/sites-available/000-default.conf
- sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/000-default.conf
# restart apache
- sudo service apache2 restart
# clone main magento github repository
- git clone https://github.com/magento/magento2
# install Magento
- cd magento2
# switch to specific branch in you like
#- git checkout 2.0;git checkout tags/2.0.2
# add composer package under test, composer require will trigger update/install
- composer require --dev fastgento/storelocator dev-master
- composer install
# run installation command using evn variables set above
- php bin/magento setup:install --admin-email "$FASTGENTO_MAGE2_ADMIN_EMAIL" --admin-firstname "$FASTGENTO_MAGE2_ADMIN_FIRST_NAME" --admin-lastname "$FASTGENTO_MAGE2_ADMIN_LAST_NAME" --admin-password "$FASTGENTO_MAGE2_ADMIN_PASSWORD" --admin-user "$FASTGENTO_MAGE2_ADMIN_USERNAME" --backend-frontname admin --base-url "$FASTGENTO_MAGE2_FAKE_URL" --db-host 127.0.0.1 --db-name magento_2_travis --db-user root --session-save files --use-rewrites 1 --use-secure 0 -vvv
# test that magento is installed
- curl "$FASTGENTO_MAGE2_FAKE_URL/index.php" > /tmp/output.txt
- vendor/phpunit/phpunit/phpunit -c dev/tests/unit/phpunit.xml.dist vendor/fastgento/storelocator/Test/Unit
script: test 'grep -Fx "magento-2-travis.dev" /tmp/output.txt'