From 29f6562d80c0f5d4ced42c231b81ec52cf18bf82 Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Thu, 13 Oct 2016 02:19:29 +0200 Subject: reproducible_openwrt|lede: in case of failure: copy logs to $WORKSPACE/results Signed-off-by: Holger Levsen --- bin/reproducible_openwrt_common.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'bin/reproducible_openwrt_common.sh') diff --git a/bin/reproducible_openwrt_common.sh b/bin/reproducible_openwrt_common.sh index ffaeb555..1789ae71 100644 --- a/bin/reproducible_openwrt_common.sh +++ b/bin/reproducible_openwrt_common.sh @@ -38,9 +38,20 @@ node_create_tmpdirs() { mkdir -p $TMPDIR/download } -# called as trap handler -# called on cleanup +# called as trap handler and also to cleanup after a success build master_cleanup_tmpdirs() { + # we will save the logs in case we got called as trap handler + # in a success build the logs are saved on a different function + if [ "$1" != "success"] ; then + # job failed + ssh $GENERIC_NODE1 reproducible_$TYPE node openwrt_save_logs $TMPDIR/logs.xz $TMPDIR/build || true + ssh $GENERIC_NODE2 reproducible_$TYPE node openwrt_save_logs $TMPDIR/logs.xz $TMPDIR/build || true + # save failure logs + mkdir -p $WORKSPACE/results/ + rsync -av $GENERIC_NODE1:$TMPDIR/build_logs.tar.xz $WORKSPACE/results/build_logs_b1.tar.xz + rsync -av $GENERIC_NODE2:$TMPDIR/build_logs.tar.xz $WORKSPACE/results/build_logs_b2.tar.xz + fi + ssh $GENERIC_NODE1 reproducible_$TYPE node node_cleanup_tmpdirs $TMPDIR || true ssh $GENERIC_NODE2 reproducible_$TYPE node node_cleanup_tmpdirs $TMPDIR || true -- cgit v1.2.3-70-g09d2