Jenkins CI playframe answering machine waiting for completion?

I am trying to configure Jenkins CI for the playframework.org application, but I am having problems starting the game properly after running the automatic testing team.

All tests work fine, but it seems that my script starts at the same time play auto-testand play start --%ci. When the command is launched play start --%ci, it receives a pid and that’s all, but it doesn’t work.

FILE: auto-test.sh, jenkins launches this using the execution 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
+3
source share
2 answers

Perhaps sleep time is not enough.

wait. PID play auto-test, , , .

: http://unstableme.blogspot.com/2008/06/bash-wait-command.html

+3

All Articles