[Qa-jenkins-scm] [jenkins.debian.net] 01/01: reproducible fdroid: cleanup processes + workdir on failure

Holger Levsen holger at moszumanska.debian.org
Mon Jan 25 20:29:14 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 4f5570c2c07118f22bd9146b61514cae84e6700c
Author: Holger Levsen <holger at layer-acht.org>
Date:   Mon Jan 25 21:29:05 2016 +0100

    reproducible fdroid: cleanup processes + workdir on failure
---
 bin/reproducible_setup_fdroid_build_environment.sh | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/bin/reproducible_setup_fdroid_build_environment.sh b/bin/reproducible_setup_fdroid_build_environment.sh
index d4c8d14..67a64b8 100755
--- a/bin/reproducible_setup_fdroid_build_environment.sh
+++ b/bin/reproducible_setup_fdroid_build_environment.sh
@@ -17,6 +17,24 @@ common_init "$@"
 WORKSPACE=$BASE/fdroid
 mkdir -p $WORKSPACE
 
+cleanup_all() {
+	echo "$(date -u) - cleanup in progress..."
+	killall VBoxHeadless || true
+	sleep 10
+	rm $WORKSPACE -r
+	echo "$(date -u) - cleanup done."
+}
+trap cleanup_all INT TERM EXIT
+
+# TODO:
+#
+#
+# add locking here to only run this if no build job is running…
+#
+#
+# not yet needed, as we don't have any build jobs yet
+
+
 # make sure we have the vagrant box image cached
 test -e ~/.cache/fdroidserver || mkdir -p ~/.cache/fdroidserver
 cd ~/.cache/fdroidserver
@@ -33,3 +51,7 @@ cd $WORKSPACE
 git clone https://gitlab.com/fdroid/fdroidserver.git
 cd fdroidserver
 ./makebuildserver 
+
+# remove trap
+trap - INT TERM EXIT
+echo "$(date -u) - the end."

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