3

playframework.org アプリケーション用に Jenkins CI をセットアップしようとしていますが、auto-test コマンドの実行後に play を正しく起動できません。

テストはすべて正常に実行されますが、スクリプトが両方同時に起動play auto-testされているようです。play start --%ciコマンドを実行するplay start --%ciと、pid とすべてが取得されますが、実行されていません。

ファイル: auto-test.sh、jenkins はこれを実行シェルで実行します

#!/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
4

2 に答える 2

3

睡眠時間が足りないのかもしれません。

wait代わりに使用してみてください。取得できる場合は PID を指定するか、play auto-testすべてのバックグラウンド プロセスが終了するまで待機するように依頼できます。

ここを見てください: http://unstableme.blogspot.com/2008/06/bash-wait-command.html

于 2011-03-18T21:49:57.397 に答える
0

たぶん、Play用のJenkinsプラグインを試すことができます!フレームワーク。

ここを参照してください(JenkinsとPlayに関する私の解決された問題!):CloudBees + PlayFramework + Eclipse

そしてここに:https ://wiki.jenkins-ci.org/display/JENKINS/play-plugin

于 2011-10-28T09:52:46.977 に答える