forked from gnemes/cart-magento2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
119 lines (118 loc) · 5.63 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
108
109
110
111
112
113
114
115
116
117
118
119
env:
#global environmental variables control magento instal parameters
#see also hosts in addons.
global:
- MAGE2_FAKE_URL=http://magento-2-travis.dev
- MAGE2_ADMIN_FIRST_NAME=Robert
- MAGE2_ADMIN_LAST_NAME=Hoffner
- MAGE2_ADMIN_USERNAME=admin
- MAGE2_ADMIN_PASSWORD=ih3artmagento
- MAGE2_ADMIN_DBNAME=magento_2_travis
- COMPOSER_REPOSITORY_TO_TEST=https://github.com
- COMPOSER_PACKAGE_TO_TEST="mercadopago/magento2-plugin:dev"
addons:
firefox: "40.0"
hosts:
# should match MAGE2_FAKE_URL above
- magento-2-travis.dev
language: php
sudo: required
dist: trusty
php:
- 5.6
#- 7.0
cache:
directories:
- $HOME/.composer/cache
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
- 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;';
- sudo apt-get install -y -qq apache2 libapache2-mod-fastcgi
- 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
- echo "always_populate_raw_post_data = -1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- echo "date.timezone = America/New_York" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- "~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm"
- sudo chmod 777 /home /home/travis /home/travis/build
- sudo cp -f .travis/travis-ci-apache /etc/apache2/sites-available/000-default.conf
# restart apache
# clone main magento github repository
#- git clone https://github.com/magento/magento2
- mkdir magento2
- cp -f .travis/composer.json magento2
- cd magento2
- composer global config http-basic.repo.magento.com f2618fa3a9f0fe7002b8c5edaea0ed22 3db3f6c9b5cf1734e2dfa13979ef9d3a
- composer install --no-interaction
# install Magento
- sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/000-default.conf
- sudo service apache2 restart
# 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
- echo $TRAVIS_REPO_SLUG
- composer config repositories.travis_to_test git "$COMPOSER_REPOSITORY_TO_TEST/$TRAVIS_REPO_SLUG"
- composer require "$COMPOSER_PACKAGE_TO_TEST-$TRAVIS_BRANCH"
# run installation command using evn variables set above
- php bin/magento setup:install --admin-email "$MAGE2_ADMIN_EMAIL"
--admin-firstname "$MAGE2_ADMIN_FIRST_NAME" --admin-lastname "$MAGE2_ADMIN_LAST_NAME"
--admin-password "$MAGE2_ADMIN_PASSWORD" --admin-user "$MAGE2_ADMIN_USERNAME"
--backend-frontname admin --base-url "$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 --use-sample-data
- sudo chmod 777 -R bin/ var/ pub/
- bin/magento setup:upgrade
# test that magento is installed
#- curl "$MAGE2_FAKE_URL/index.php" > /tmp/output.txt
#- cat /tmp/output.txt
- cp vendor/mercadopago/magento2-plugin/Test/behat.yml.dist vendor/mercadopago/magento2-plugin/Test/behat.yml
- sed -e "s?%MAGENTO_URL%?http://magento-2-travis.dev/?g" --in-place vendor/mercadopago/magento2-plugin/Test/behat.yml
- sed -e "s?%BROWSER_DRIVER%?firefox?g" --in-place vendor/mercadopago/magento2-plugin/Test/behat.yml
- sed -e "s?%APP_BOOTSTRAP%?$(pwd)/app/bootstrap.php?g" --in-place vendor/mercadopago/magento2-plugin/Test/behat.yml
- cd vendor/mercadopago/magento2-plugin/Test
- composer install --no-interaction
- sh -e /etc/init.d/xvfb start
- export DISPLAY=:99.0
- wget http://selenium-release.storage.googleapis.com/2.47/selenium-server-standalone-2.47.1.jar
- java -jar selenium-server-standalone-2.47.1.jar -log /tmp/selenium.log > /dev/null
&
- ls -al
- sudo cat /var/log/apache2/errormp.log
script:
- vendor/bin/behat --config behat.yml --tags @magento2 --tags="~@skip"
- sudo cat /var/log/apache2/errormp.log
- cd "$TRAVIS_BUILD_DIR/magento2"
- cd var/log
- tail -n 100 *log