summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2016-10-13 02:19:29 +0200
committerHolger Levsen <holger@layer-acht.org>2016-10-13 10:48:20 +0200
commit29f6562d80c0f5d4ced42c231b81ec52cf18bf82 (patch)
treeab3c70b1496fd2453f46e9bcb9b7c652bfd099e3
parent3c0a4c8ca8858a4473a90508f3d1bfa871e1f410 (diff)
downloadjenkins.debian.net-29f6562d80c0f5d4ced42c231b81ec52cf18bf82.tar.xz
reproducible_openwrt|lede: in case of failure: copy logs to $WORKSPACE/results
Signed-off-by: Holger Levsen <holger@layer-acht.org>
-rwxr-xr-xbin/reproducible_lede.sh2
-rwxr-xr-xbin/reproducible_openwrt.sh2
-rw-r--r--bin/reproducible_openwrt_common.sh15
3 files changed, 15 insertions, 4 deletions
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