forked from filesender/filesender
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.travis.yml
100 lines (99 loc) · 5.83 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
dist: trusty
sudo: required
language: php
php:
- 7.2
services:
- postgresql
- mariadb
addons:
mariadb: '10.0'
sauce_connect:
username: "$SAUCE_USERNAME"
no-ssl-bump-domains: file_sender.app
hosts:
- file_sender.app
jwt:
secure: Dfap55GeoeDedJPwqtX3o7AEdZ48gGdOcgYOKNDZu4+9xKsuxFG4n9UKbF7H378XCuoS+og+vpdJ+PZhmbsvd09/zdNw8HWoRRixGG1sDLg97NOX3ImjCoeSPcOVoiYwH/uVP22NnW2orhBwzeYo6OaX9Eb7Q9soXgoNRuPC3i7lsHVx7duB3lfc1bv1Bay6RmxtBfGXj4Q7mwMseoejL0PiYICWJ2H5KFt2Cd3qTIXhl2moMREyovwji97bQXv45XW2n7pUfEgSQJvdxd5tJvcu8ngYQq7YIeOmhYf3QyYVB8NIgI/iOI1CldGCE9pTSEfMGzkATi2OKJHrHurETHEhWEgFzNheYxlh/eTZqGuHN767r1XQID/lQ/kNiOjZyvTkGw2oCwpz9G3exNTo95AaG52OB1vb8MwnupmDXk+ozm3ZECsfnad1UAawVvTYB6CgUF1sg2RQH7quhmYyDQB5j9SLJ9xMsYo06ttBtABgiAzs9P/73gVKO9f13Qvy+ZSF2elzpCBO23B1gm9j/zmi3NW8cPmYEq/6spGV4K2T7RGATAPgeX98+QHAOLMWUo7TWl/oJVH4P+ocMgdSgGpp9cyE0kAFQyZ62vU29Z4xIua1t1gDr/LbrpMj5LJls5YfhFwuNYLACKDJto+AlGj4vqWyDi0kivVqsrdGqx4=
before_install:
- composer self-update
- composer update --no-interaction
- cp ./travis/filesender-config.php ./config/config.php
- sh -c "if [ '$DB' = 'mysql' ]; then sudo sed -e "s?usemysql=0?usemysql=1?g" --in-place ./config/config.php ; fi "
- sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place ./config/config.php
- chmod -R a+x ./travis/scripts
- phpenv config-add ./travis/php-config.ini
install:
- mkdir ./log
- mkdir ./tmp
- mkdir ./files
- sh -c "if [ '$DB' = 'pgsql' ]; then ./travis/scripts/postgresql-setup.sh ; fi "
- sh -c "if [ '$DB' = 'mysql' ]; then ./travis/scripts/mariadb-setup.sh ; fi "
- "./travis/scripts/simplesamlphp-setup.sh"
- php scripts/upgrade/database.php
- sh -c "if [ '$TESTSUITE' = 'dataset' ]; then php scripts/upgrade/database.php --db_database filesenderdataset ; fi "
- echo "Sauce connect will start soon if this is a browser test session"
- echo " otherwise it will close early, "
- echo " but that is ok as we will not need it in this VM "
before_script:
- sudo apt-get update
- sudo apt-get install curl
- sudo apt-get install apache2 libapache2-mod-fastcgi
- sudo a2enmod rewrite actions fastcgi alias ssl headers
- sudo sed -i "s/host all all 127.0.0.1\/32 trust/host all all 127.0.0.1\/32 md5/"
/etc/postgresql/9.2/main/pg_hba.conf
- sudo sed -i "s/host all all ::1\/128 trust/host all all ::1\/128 md5/"
/etc/postgresql/9.2/main/pg_hba.conf
- sudo sed -i "s/NameVirtualHost \*:80/# NameVirtualHost \*:80/" /etc/apache2/ports.conf
- sudo sed -i "s/Listen 80/# Listen 80/" /etc/apache2/ports.conf
#- sudo echo '<?php' >| $TRAVIS_BUILD_DIR/www/info.php
#- sudo echo 'phpinfo();' >> $TRAVIS_BUILD_DIR/www/info.php
#- sudo chown www-data $TRAVIS_BUILD_DIR/www/info.php
- sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/certs/filesender_test.key
-out /etc/ssl/certs/filesender_test.crt -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=file_sender.app"
- sudo cp -f travis/apache2.conf /etc/apache2/sites-enabled/000-default.conf
- sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-enabled/000-default.conf
- sudo service postgresql restart
# enable php-fpm
- sudo sed -i "s/error_reporting = E_ALL/error_reporting = E_ALL \& ~E_DEPRECATED
\& ~E_STRICT/" ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- 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
- sudo sed -i -e "s,www-data,travis,g" /etc/apache2/envvars
- sudo chown -R travis:travis /var/lib/apache2/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
#- sudo sed -i -e "s,nobody,travis,g " ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf
- ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
- sudo cat /etc/apache2/sites-enabled/000-default.conf
- echo "... making sure sauce connect doesn't redefine ..."
- sudo sed -i -e "s,define('SAUCE_HOST',if(\!defined('SAUCE_HOST')) define('SAUCE_HOST',g" /home/travis/build/filesender/filesender/vendor/sauce/sausage/src/Sauce/Sausage/SauceAPI.php
- sudo sed -i -e "s,define('SAUCE_HOST',if(\!defined('SAUCE_HOST')) define('SAUCE_HOST',g" /home/travis/build/filesender/filesender/vendor/sauce/sausage/src/Sauce/Sausage/SauceConfig.php
- sudo service apache2 restart
#- curl -k https://localhost/filesender/info.php || sudo cat /var/log/apache2/*.log
# stop the database we are not planning to use
# to catch bad configurations that might use the wrong database by mistake
- sh -c "if [ '$DB' = 'pgsql' ]; then sudo service mysql stop ; fi "
- sh -c "if [ '$DB' = 'mysql' ]; then sudo service postgresql stop ; fi "
after_failure:
- sudo cat /var/log/apache2/error.log
- sudo cat /var/log/apache2/access.log
- find ./log -type f -exec cat {} +
script:
- ./vendor/bin/phpunit --configuration ./unittests/config_tests_filesender.xml --testsuite=$TESTSUITE
notifications:
email: false
##
## I have used DB as pgsql and mysql as this is what filesender uses for config db_type
matrix:
include:
- name: pgsql-core
env: DB=pgsql TESTSUITE=core TRAVIS_SAUCE_CONNECT=false SAUCE_USERNAME=
- name: pgsql-selenium1
env: DB=pgsql TESTSUITE=selenium SAUCE_TUNNEL_IDENTIFIER=$TRAVIS_JOB_NUMBER SAUCE_DONT_VERIFY_CERTS=1
- name: pgsql-dataset
env: DB=pgsql TESTSUITE=dataset TRAVIS_SAUCE_CONNECT=false SAUCE_USERNAME=
- name: mysql-core
env: DB=mysql TESTSUITE=core TRAVIS_SAUCE_CONNECT=false SAUCE_USERNAME=
- name: mysql-selemium1
env: DB=mysql TESTSUITE=selenium SAUCE_TUNNEL_IDENTIFIER=$TRAVIS_JOB_NUMBER SAUCE_DONT_VERIFY_CERTS=1