silverstripe-behat-extension/bin/behat-ss
2018-03-16 11:42:37 +13:00

21 lines
482 B
Bash
Executable File

#!/bin/sh
echo "setting up /artifacts"
mkdir -p artifacts
echo "starting chromedriver"
chromedriver &> artifacts/chromedriver.log 2> artifacts/chromedriver-error.log &
cd_pid=$!
echo "starting webserver"
vendor/bin/serve &> artifacts/serve.log 2> artifacts/serve-error.log &
ws_pid=$!
echo "starting behat"
vendor/bin/behat "$@"
echo "killing webserver (PID: $ws_pid)"
pkill -TERM -P $ws_pid &> /dev/null
echo "killing chromedriver (PID: $cd_pid)"
kill -9 $cd_pid &> /dev/null