Translated using Weblate (Slovenian)
[phpmyadmin.git] / test / start-local-server
blob4519af68bb61ed951edb8d79c96d2140ff86e92c
1 #!/bin/sh
3 # Do not run as CGI
4 if [ -n "$GATEWAY_INTERFACE" ] ; then
5 echo 'Can not invoke as CGI!'
6 exit 1
7 fi
9 set -e
10 set -x
12 if [ "$CI_MODE" != "selenium" ] ; then
13 echo "Not in CI_MODE=selenium"
14 exit 0
17 # Start php-fpm + nginx in temporary dir
18 DIR=`mktemp -d --suffix=-phpMyAdminTest`
19 CURRENT=`pwd`
21 # Create configuration with correct paths
22 cp test/nginx.conf test/php-fpm.conf test/php.ini $DIR/
23 sed -i -e "s,%DIR%,$DIR," -e "s,%ROOT%,$CURRENT," $DIR/*
24 mkdir $DIR/sessions
26 echo "Using temporary dir: ${DIR}"
28 # You can define FPM_PATH to override the path for example FPM_PATH="php-fpm7.4"
29 FPM_PATH="${FPM_PATH:-php-fpm}"
31 # Start servers
32 "$FPM_PATH" --fpm-config $DIR/php-fpm.conf -c $DIR/php.ini
33 ${NGINX_PATH:-nginx} -c $DIR/nginx.conf
35 if [ ! -z "$TESTSUITE_BROWSERSTACK_KEY" ] ; then
36 echo "Using: BrowserStack"
37 # Install if necessary
38 if [ ! -f ~/browserstack/BrowserStackLocal ] ; then
39 mkdir -p ~/browserstack
40 cd ~/browserstack
41 wget https://www.browserstack.com/browserstack-local/BrowserStackLocal-linux-x64.zip
42 unzip BrowserStackLocal-linux-x64.zip
44 # Start BrowserStack Local forwarder
45 ~/browserstack/BrowserStackLocal --force-local --localIdentifier "gh-$GITHUB_ACTION" --onlyAutomate --key "$TESTSUITE_BROWSERSTACK_KEY" --daemon start
46 elif [ -z "$SKIP_STANDALONE" ] ; then
47 echo "Using: selenium-standalone"
48 if [ ! -f selenium-standalone ]; then
49 yarn global add selenium-standalone
50 selenium-standalone install
52 selenium-standalone start -- -debug > ~/selenium-standalone.logs~ 2>&1 &
53 echo $! > ~/selenium-standalone.pid~
54 else
55 echo "Using: nothing."
58 echo "${DIR}" > /tmp/last_temp_dir_phpMyAdminTests