forked from gnemes/cart-magento2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
93 lines (87 loc) · 4.21 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
language: php
php:
- 5.5
cache:
apt: true
directories:
- $HOME/.composer/cache
- $HOME/.cache/bin
env:
global:
- MAGENTO_DB_NAME=magento2
- MAGENTO_URL=mercadopago2.local
- DB=mysql
matrix:
- BEHAT_TAG=@MercadoPagoStandard
addons:
hosts:
- mercadopago2.local
before_install:
- sudo apt-get update -qq
- sudo apt-get install -y -qq postfix
- sh -c 'if [ "$CASHER_DIR" ]; then
if [ -x $HOME/.cache/bin/composer ]; then
$HOME/.cache/bin/composer self-update; echo '';
else
mkdir -p $HOME/.cache/bin;
curl --connect-timeout 30 -sS https://getcomposer.org/installer
| php -- --install-dir $HOME/.cache/bin/ --filename composer;
fi
fi'
- export PATH="$HOME/.cache/bin:$PATH"
- composer self-update
- "sudo apt-get remove mysql-common mysql-server-5.5 mysql-server-core-5.5 mysql-client-5.5 mysql-client-core-5.5"
- "sudo apt-get autoremove"
- "sudo apt-get install libaio1"
- "wget -O mysql-5.6.14.deb http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.14-debian6.0-x86_64.deb/from/http://cdn.mysql.com/"
- "sudo dpkg -i mysql-5.6.14.deb"
- "sudo cp /opt/mysql/server-5.6/support-files/mysql.server /etc/init.d/mysql.server"
- "sudo ln -s /opt/mysql/server-5.6/bin/* /usr/bin/"
- "sudo sed -i'' 's/table_cache/table_open_cache/' /etc/mysql/my.cnf"
- "sudo sed -i'' 's/log_slow_queries/slow_query_log/' /etc/mysql/my.cnf"
- "sudo sed -i'' 's/basedir[^=]\\+=.*$/basedir = \\/opt\\/mysql\\/server-5.6/' /etc/mysql/my.cnf"
- "sudo /etc/init.d/mysql.server start"
install:
- sudo apt-get install apache2 libapache2-mod-fastcgi
before_script:
- sudo service postfix stop
- smtp-sink -d "%d.%H.%M.%S" localhost:2500 1000 &
- echo -e '#!/usr/bin/env bash\nexit 0' | sudo tee /usr/sbin/sendmail
- >
echo 'sendmail_path = "/usr/sbin/sendmail -t -i "'
| sudo tee "/home/travis/.phpenv/versions/`php -i
| grep "PHP Version"
| head -n 1
| grep -o -P '\d+\.\d+\.\d+.*'`/etc/conf.d/sendmail.ini"
# 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
# configure apache virtual hosts
- sudo cp -f .travis/travis-ci-apache /etc/apache2/sites-available/default
- sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/default
- sudo service apache2 restart
- cp -f .travis/composer.json composer.json
- composer global config http-basic.repo.magento.com f2618fa3a9f0fe7002b8c5edaea0ed22 3db3f6c9b5cf1734e2dfa13979ef9d3a
- composer install --no-interaction
- mkdir tmp
- mysql -e "DROP DATABASE IF EXISTS ${MAGENTO_DB_NAME}; CREATE DATABASE ${MAGENTO_DB_NAME};"
- sudo chown -R :www-data .
- sudo find . -type d -exec chmod 770 {} \; && sudo find . -type f -exec chmod 660 {} \; && sudo chmod u+x bin/magento
- bin/magento setup:install --backend-frontname=admin --db-host=localhost --db-name=magento2 --db-user=travis --base-url=http://${MAGENTO_URL}/ --use-secure-admin=0 --admin-user=admin --admin-password=MercadoPago2016 [email protected] --admin-firstname=Facundo --admin-lastname=Capua --cleanup-database --use-sample-data
- cd app/code/MercadoPago/Core/Test
- cp behat.yml.dist behat.yml
- sed -e "s?%MAGENTO_URL%?http://${MAGENTO_URL}/?g" --in-place behat.yml
- sed -e "s?%BROWSER_DRIVER%?firefox?g" --in-place behat.yml
- 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 &"
- sleep 5
script:
- vendor/bin/phpmd ../../../MercadoPago text static/phpmd/ruleset.xml --exclude Test
#- vendor/bin/phpcs --standard=static/phpcs/Ecg --colors ../../../../../app/
- vendor/bin/phpcpd ../../../MercadoPago --exclude=Test
- vendor/bin/behat --config behat.yml --tags ${BEHAT_TAG} --tags="~@skip"