forked from idno/known
-
Notifications
You must be signed in to change notification settings - Fork 5
/
.travis.yml
80 lines (72 loc) · 3.23 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
language: php
php:
- 7.3
- 7.4
- 8.0
# Configure different DB environments
env:
- DB=mysql
- DB=mongo
matrix:
allow_failures:
- php: 7.2
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 libxml2-utils curl
- sudo a2enmod headers
# Enable php-fpm
- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
- 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 a2enmod rewrite actions fastcgi alias
# Enable mongo extension
- echo "extension = mongodb.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini;
# Enable vhost
- sudo cp -f Tests/build/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
# 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/configuration/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 ./warmup/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/configuration/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 ./warmup/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/configuration/config.ini; fi
- sudo cp -f $TRAVIS_BUILD_DIR/warmup/webserver-configs/htaccess.dist $TRAVIS_BUILD_DIR/.htaccess
# Restart services
- ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
- sudo service apache2 restart
# Ensure composer has installed dependancies
- composer install --no-dev --ignore-platform-reqs
services:
- mongodb
- postgresql
- mysql
addons:
apt:
sources:
- mongodb-3.4-precise
packages:
- mongodb-org-server
after_failure:
- sudo cat $TRAVIS_BUILD_DIR/apache-error.log
notifications:
email:
irc:
channels:
- "irc.freenode.net#knownchat"
on_success: change
on_failure: always