Jenkinsのタスク登録した際のメモ
やりかた
/Applications/Unity/Unity.app/Contents/MacOS/Unity \
-batchmode \
-logfile /tmp/unity.log \
-projectPath `pwd` \
-runEditorTests
こんな感じで実行するだけ。
スクリプト
もうちょっと便利にログ出したり、見やすくしてJenkinsから走らせている
#!/bin/bash
CMD=/Applications/Unity/Unity.app/Contents/MacOS/Unity
LOG=/tmp/unity.log
PROJECT_DIR=`pwd`
$CMD \
-batchmode \
-logfile $LOG \
-projectPath $PROJECT_DIR \
-runEditorTests
RESULT=$?
if [ $RESULT -ne 0 ]; then
cat $LOG
fi
if [ $RESULT -eq 0 ]; then
echo "🙆 run succeeded. test passed."
elif [ $RESULT -eq 2 ]; then
echo "🙅 run succeeded. test failed."
else
echo "🙅 run failure."
fi
exit $RESULT