blob: 08f9f4eb32b33e3aaf7b4d47aca70829d45f87c3 (
plain)
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
|
#!/bin/sh
# Do not run as CGI
if [ -n "$GATEWAY_INTERFACE" ] ; then
echo 'Can not invoke as CGI!'
exit 1
fi
set -e
set -x
if [ "$CI_MODE" != "selenium" -o -z "$TESTSUITE_BROWSERSTACK_KEY" ] ; then
exit 0
fi
# Start php-fpm + nginx in temporary dir
DIR=`mktemp -d`
CURRENT=`pwd`
PHP_VERSION=$(phpenv version-name)
# Create configuration with correct paths
cp test/nginx.conf test/php-fpm.conf test/php.ini $DIR/
sed -i -e "s@%DIR%@$DIR@" -e "s@%ROOT%@$CURRENT@" $DIR/*
mkdir $DIR/sessions
# Start servers
$HOME/.phpenv/versions/$PHP_VERSION/sbin/php-fpm --fpm-config $DIR/php-fpm.conf -c $DIR/php.ini
nginx -c $DIR/nginx.conf
# Start BrowserStack Local forwarder
~/browserstack/BrowserStackLocal --force-local --localIdentifier "travis-$TRAVIS_JOB_NUMBER" --onlyAutomate --key "$TESTSUITE_BROWSERSTACK_KEY" --daemon start
|