forked from mapkyca/idno
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
75 lines (68 loc) · 3.26 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
language: php
dist: precise
php:
- 5.4
- 5.5
- 5.6
- 7.0
# Configure different DB environments
env:
- DB=mysql
- DB=mongo
- DB=sqlite3
- DB=pgsql
matrix:
allow_failures:
- php: 5.4
- php: 5.5
branches:
only:
- master
before_script:
# Update and install base system
- sudo apt-get update
- sudo apt-get install -y --force-yes apache2 libapache2-mod-fastcgi make
- sudo apt-get install -y --force-yes php5-dev php-pear php5-mysql php5-curl php5-gd php5-json php5-sqlite php5-pgsql libxml2-utils curl
- sudo a2enmod headers
# Enable php-fpm and Mongodb
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.0" ]]; then sudo cp Tests/build/www.conf ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/; fi
- 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
#- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.0" ]]; then sudo printf "\n" | pecl install mongodb; fi
- echo "extension = mongodb.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini;
- 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 Tests/build/travis-ci-apache /etc/apache2/sites-available/default
- sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/default
# Configure Known
- if [[ "$DB" == "pgsql" ]]; then echo "PROVISIONING WITH PostgreSQL"; fi
- if [[ "$DB" == "pgsql" ]]; then sudo cp -f Tests/build/config_pgsql.ini $TRAVIS_BUILD_DIR/config.ini; fi
- if [[ "$DB" == "pgsql" ]]; then psql -c 'create database known_unittest;' -U postgres; fi
- if [[ "$DB" == "pgsql" ]]; then psql -U postgres -d known_unittest -a -f ./schemas/postgres/postgres.sql; fi
- if [[ "$DB" == "pgsql" ]]; then psql -d known_unittest -c '\dt;' -U postgres; fi
- if [[ "$DB" == "mysql" ]]; then echo "PROVISIONING WITH MySQL"; fi
- if [[ "$DB" == "mysql" ]]; then sudo cp -f Tests/build/config_mysql.ini $TRAVIS_BUILD_DIR/config.ini; fi
- if [[ "$DB" == "mysql" ]]; then mysql --version; fi
- if [[ "$DB" == "mysql" ]]; then mysql -e "CREATE DATABASE known_unittest;" -uroot; fi
- if [[ "$DB" == "mysql" ]]; then mysql -e "GRANT ALL ON known_unittest.* TO 'travis'@'127.0.0.1';" -uroot; fi
- if [[ "$DB" == "mysql" ]]; then mysql -e "USE known_unittest; SOURCE ./schemas/mysql/mysql.sql; show table status; show index from entities;" -utravis; fi
- if [[ "$DB" == "mongo" ]]; then echo "PROVISIONING WITH MongoDB (default)"; fi
- if [[ "$DB" == "mongo" ]]; then sudo cp -f Tests/build/config_default.ini $TRAVIS_BUILD_DIR/config.ini; fi
- if [[ "$DB" == "sqlite3" ]]; then echo "PROVISIONING WITH Sqlite"; fi
- if [[ "$DB" == "sqlite3" ]]; then sudo cp -f Tests/build/config_sqlite3.ini $TRAVIS_BUILD_DIR/config.ini; fi
- sudo cp -f $TRAVIS_BUILD_DIR/htaccess.dist $TRAVIS_BUILD_DIR/.htaccess
# Restart services
- sudo service apache2 restart
services:
- mongodb
after_failure:
- sudo cat $TRAVIS_BUILD_DIR/apache-error.log
notifications:
email:
irc:
channels:
- "irc.freenode.net#knownchat"
on_success: change
on_failure: always