Я пытаюсь настроить Jenkins CI для приложения playframework.org, но у меня возникают проблемы с правильным запуском play после запуска команды автоматического тестирования.
Все тесты работают нормально, но кажется, что мой скрипт запускает одновременно и play auto-test
, и play start --%ci
. Когда команда play start --%ci
запускается, она получает pid и все, но она не выполняется.
FILE: auto-test.sh, jenkins запускает это с помощью execute shell
#!/bin/bash
# pwd is jenkins workspace dir
# change into approot dir
cd customer-portal;
# kill any previous play launches
if [ -e "server.pid" ]
then
kill `cat server.pid`;
rm -rf server.pid;
fi
# drop and re-create the DB
mysql --user=USER --password=PASS --host=HOSTNAME < ../setupdb.sql
# auto-test the most recent build
/usr/local/lib/play/play auto-test;
# this is inadequate for waiting for auto-test to complete?
# how to wait for actual process completion?
# sleep 60;
wait;
# Conditional start based on tests
# Launch normal on pass, test on fail
#
if [ -e "./test-result/result.passed" ]
then
/usr/local/lib/play/play start --%ci;
exit 0;
else
/usr/local/lib/play/play test;
exit 1;
fi