node.js と mocha プラグインを使用しています。Jenkins からテストを実行する必要があります。
テスト ディレクトリは '/home/user/tests' です。パテを使用してコマンド 'make all' を開始し、テストを実行して結果を得ることができます。どうすれば bash スクリプトから実行できますか?
ファイル「start.sh」にスクリプトを作成しました。
#!/bin/bash
DIR=$(cd /home/user/tests; make all)
echo "-----------------------START----$stDate--------------------"
echo $DIR
echo "------------------------END-----$enDate--------------------"
この場合、結果は
08:10:58 SSH: EXEC: STDOUT/STDERR from command [start.sh] ...
08:10:59 /bin/sh: mocha: command not found
08:10:59 /bin/sh: mocha: command not found
08:10:59 /bin/sh: mocha: command not found
08:10:59 /bin/sh: line 0: cd: ./messagel: No such file or directory
08:10:59 -----------------------START----Mon Sep 3 08:11:00 EDT 2012--------------------
08:10:59 cd ./tenant; mocha; cd ../; cd ./user; mocha --reporter list; cd ../; cd ./asset; mocha; cd ../; cd ./messagel mocha -t 5000; cd ../;
08:10:59 ------------------------END-----Mon Sep 3 08:11:00 EDT 2012--------------------
08:10:59 SSH: EXEC: completed after 401 ms
ただし、これはファイル「makefile」に含まれており、cd ./tenant; は実行されません。モカ; CD ../; cd ./ユーザー; mocha --レポーターリスト; CD ../; cd ./asset; モカ; CD ../; cd ./messagel モカ -t 5000; CD ../;