playframework auto-test Jenkins CI wait for completion?
Posted
by
notbrain
on Stack Overflow
See other posts from Stack Overflow
or by notbrain
Published on 2011-03-18T21:43:03Z
Indexed on
2011/03/19
0:10 UTC
Read the original article
Hit count: 507
I am trying to set up Jenkins CI for a playframework.org application but am having trouble properly launching play after the auto-test command is run.
The tests all run fine, but it seems as though my script is launching both play auto-test
and play start --%ci
at the same time. When the play start --%ci
command runs, it gets a pid and everything, but it's not running.
FILE: auto-test.sh, jenkins runs this with 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
© Stack Overflow or respective owner