From ec752decc7cfe02139bda017e67a9b064a6efcc0 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sun, 12 Jun 2016 21:12:07 +0200 Subject: [PATCH] Archive build assets if job failed. --- script/build/test_shutdown.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/script/build/test_shutdown.sh b/script/build/test_shutdown.sh index a80f88245..fcca59cfc 100755 --- a/script/build/test_shutdown.sh +++ b/script/build/test_shutdown.sh @@ -6,6 +6,7 @@ EXIT=$4 || 0 WITH_DB=$5 || 0 SERVER_PID='tmp/pids/server.pid' +LOG_HOST='cilog@schneeberg.znuny.com' script/scheduler.rb stop script/websocket-server.rb stop @@ -19,4 +20,11 @@ if test $WITH_DB -eq 1; then script/build/test_cleanup.sh fi +# if build has failed, copy logs for analyzing +if test $EXIT -eq 1; then + ssh $LOG_HOST "mkdir -p logs/$CI_BUILD_ID" + scp -C log/* $LOG_HOST:logs/$CI_BUILD_ID/ + scp -C tmp/screenshot* $LOG_HOST:logs/$CI_BUILD_ID/ +fi + exit $EXIT