[Qa-jenkins-scm] [jenkins.debian.net] 02/02: reproducible_openwrt|lede: in case of failure: copy logs to $WORKSPACE/results

Holger Levsen holger at layer-acht.org
Thu Oct 13 08:48:27 UTC 2016


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit 29f6562d80c0f5d4ced42c231b81ec52cf18bf82
Author: Alexander Couzens <lynxis at fe80.eu>
Date:   Thu Oct 13 02:19:29 2016 +0200

    reproducible_openwrt|lede: in case of failure: copy logs to $WORKSPACE/results
    
    Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
 bin/reproducible_lede.sh           |  2 +-
 bin/reproducible_openwrt.sh        |  2 +-
 bin/reproducible_openwrt_common.sh | 15 +++++++++++++--
 3 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/bin/reproducible_lede.sh b/bin/reproducible_lede.sh
index fe4adcb..2ee4789 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 c071cf4..161fe4d 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 ffaeb55..1789ae7 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
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list