summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2016-08-06 02:15:18 +0200
committerHolger Levsen <holger@layer-acht.org>2016-08-06 02:17:44 +0200
commitd2728ceca963fb1a0d7138a67927bc44e0739749 (patch)
tree485bdc0bafd2f9fbd5d9b78faa506b9dd37bb22c
parent64a249a4bf39aa14fea28c3c38c90b1fef4ab749 (diff)
downloadjenkins.debian.net-d2728ceca963fb1a0d7138a67927bc44e0739749.tar.xz
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@layer-acht.org>
-rw-r--r--bin/reproducible_openwrt_common.sh22
1 files changed, 12 insertions, 10 deletions
diff --git a/bin/reproducible_openwrt_common.sh b/bin/reproducible_openwrt_common.sh
index 2041e989..77649087 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