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_lede.sh | 2 +- bin/reproducible_openwrt.sh | 2 +- bin/reproducible_openwrt_common.sh | 15 +++++++++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) (limited to 'bin') diff --git a/bin/reproducible_lede.sh b/bin/reproducible_lede.sh index fe4adcb2..2ee47897 100755 --- a/bin/reproducible_lede.sh +++ b/bin/reproducible_lede.sh @@ -254,5 +254,5 @@ irc_message reproducible-builds "$REPRODUCIBLE_URL/lede/ has been updated. ($GOO echo "=============================================================================" # remove everything, we don't need it anymore... -master_cleanup_tmpdirs +master_cleanup_tmpdirs success trap - INT TERM EXIT diff --git a/bin/reproducible_openwrt.sh b/bin/reproducible_openwrt.sh index c071cf4e..161fe4d1 100755 --- a/bin/reproducible_openwrt.sh +++ b/bin/reproducible_openwrt.sh @@ -245,5 +245,5 @@ irc_message reproducible-builds "$REPRODUCIBLE_URL/openwrt/ has been updated. ($ echo "=============================================================================" # remove everything, we don't need it anymore... -master_cleanup_tmpdirs +master_cleanup_tmpdirs success trap - INT TERM EXIT 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-54-g00ecf