forked from OpenConext/Stepup-tiqr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
72 lines (58 loc) · 2.36 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
language: php
dist: trusty
addons:
hosts:
- tiqr.example.com
apt:
packages:
- cmake
- apache2
php:
- 5.6
- 7.0
- 7.1
cache:
directories:
- ~/.composer/cache/files
before_script:
# configure ssl
- sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/certs/gssp.key -out /etc/ssl/certs/gssp.crt -subj "/C=NL/ST=Netherlands/L=Amsterdam/O=TEST/CN=tiqr.example.com"
- sudo apt-get update
- sudo apt-get install apache2 libapache2-mod-fastcgi
- export PHP_VERSION=$(phpenv version-name)
- sudo cp ~/.phpenv/versions/${PHP_VERSION}/etc/php-fpm.conf.default ~/.phpenv/versions/${PHP_VERSION}/etc/php-fpm.conf
- sudo cp ~/.phpenv/versions/${PHP_VERSION}/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/${PHP_VERSION}/etc/php-fpm.d/www.conf || true
- sudo a2enmod rewrite actions fastcgi alias ssl proxy proxy_fcgi
- echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/${PHP_VERSION}/etc/php.ini
- sudo sed -i -e "s,www-data,travis,g" /etc/apache2/envvars
- sudo chown -R travis:travis /var/lib/apache2/fastcgi
- ~/.phpenv/versions/${PHP_VERSION}/sbin/php-fpm
# configure apache virtual hosts
- sudo cp -f ${TRAVIS_BUILD_DIR}/travis-ci-apache.conf /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
- sudo sed -e "s?%PHP_VERSION%?${PHP_VERSION}?g" --in-place /etc/apache2/sites-available/000-default.conf
- sudo cat /etc/apache2/sites-available/000-default.conf
# Create apache error log.
- touch $TRAVIS_BUILD_DIR/error.log
- touch $TRAVIS_BUILD_DIR/access.log
- sudo service apache2 restart
# Install dependencies
- composer install
- composer encore dev
# Check if everything runs properly
- ps aux | grep php-fpm
- netstat -an | grep :9000
- curl --insecure https://tiqr.example.com
- curl --insecure https://tiqr.example.com/bootstrap.min.js
script:
# Test if the website is actually running
- composer test
# Only run behat on PHP>5.6, this is not ideal, but we can't work around
# this PHP bug: https://bugs.php.net/bug.php?id=72286
- (php --version | grep -q 'PHP 5\.6\.') || composer behat
after_script:
- cat $TRAVIS_BUILD_DIR/error.log
- cat $TRAVIS_BUILD_DIR/access.log
- cat $TRAVIS_BUILD_DIR/build/*.html
- sudo cat /var/log/syslog
- cat $TRAVIS_BUILD_DIR/var/logs/*