[Qa-jenkins-scm] [jenkins.debian.net] 02/02: reproducible/openwrt|lede: decouple node and master cleanup

Holger Levsen holger at layer-acht.org
Sat Aug 6 00:18:01 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 d2728ceca963fb1a0d7138a67927bc44e0739749
Author: Alexander Couzens <lynxis at fe80.eu>
Date:   Sat Aug 6 02:15:18 2016 +0200

    reproducible/openwrt|lede: decouple node and master cleanup
    
    master and nodes use a different cleanup function because the node have
    different build dirs
    
    Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
 bin/reproducible_openwrt_common.sh | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/bin/reproducible_openwrt_common.sh b/bin/reproducible_openwrt_common.sh
index 2041e98..7764908 100644
--- a/bin/reproducible_openwrt_common.sh
+++ b/bin/reproducible_openwrt_common.sh
@@ -10,23 +10,25 @@ GENERIC_NODE1=profitbricks-build3-amd64.debian.net
 GENERIC_NODE2=profitbricks-build4-amd64.debian.net
 
 # run on jenkins master
-master_cleanup_tmpdirs() {
-	ssh $GENERIC_NODE1 reproducible_$TYPE node node_cleanup_tmpdirs $TMPDIR || true
-	ssh $GENERIC_NODE2 reproducible_$TYPE node node_cleanup_tmpdirs $TMPDIR || true
-	# cleanup local dirs
-	cleanup_tmpdirs
-}
 
 # only called direct on a remote build node
 node_cleanup_tmpdirs() {
 	export TMPDIR=$1
-	export TMPBUILDDIR=$TMPDIR/build
-	cleanup_tmpdirs
+	cd
+	# (very simple) check we are deleting the right stuff
+	if [ "${TMPDIR:0:26}" != "/srv/reproducible-results/" ] || [ ${#TMPDIR} -le 26 ] ; then
+		echo "Something very strange with \$TMPDIR=$TMPDIR exiting instead of doing cleanup."
+		exit 1
+	fi
+	rm -rf $TMPDIR
 }
 
 # called as trap handler
 # called on cleanup
-cleanup_tmpdirs() {
+master_cleanup_tmpdirs() {
+	ssh $GENERIC_NODE1 reproducible_$TYPE node node_cleanup_tmpdirs $TMPDIR || true
+	ssh $GENERIC_NODE2 reproducible_$TYPE node node_cleanup_tmpdirs $TMPDIR || true
+
 	cd
 	# (very simple) check we are deleting the right stuff
 	if [ "${TMPDIR:0:26}" != "/srv/reproducible-results/" ] || [ ${#TMPDIR} -le 26 ] || \
@@ -230,7 +232,7 @@ openwrt_build() {
 		exit 1
 	fi
 	mkdir -p $TMPBUILDDIR
-	trap cleanup_tmpdirs INT TERM EXIT
+	trap node_cleanup_tmpdirs INT TERM EXIT
 
 	# we have also to set the TMP
 

-- 
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