[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] Cleanup with sudo

Holger Levsen (@holger) gitlab at salsa.debian.org
Mon Jun 21 14:31:27 BST 2021



Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net


Commits:
31b0c6c5 by Roland Clobus at 2021-06-21T15:30:27+02:00
Cleanup with sudo
Call 'lb config' before the second build

Signed-off-by: Holger Levsen <holger at layer-acht.org>

- - - - -


2 changed files:

- bin/reproducible_debian_live_build.sh
- hosts/osuosl173-amd64/etc/sudoers.d/live-build


Changes:

=====================================
bin/reproducible_debian_live_build.sh
=====================================
@@ -23,9 +23,7 @@ output_echo() {
 
 cleanup() {
 	# Cleanup the workspace
-	if [ ! -z "${TMPDIR}" ] ; then
-		rm -rf --one-file-system ${TMPDIR}
-	fi
+	sudo rm -rf --one-file-system /srv/workspace/live-build
 }
 
 #
@@ -37,7 +35,8 @@ trap cleanup INT TERM EXIT
 
 # Generate and use an isolated workspace
 export PROJECTNAME="live-build"
-export TMPDIR=$(mktemp -d -t ${PROJECTNAME}.XXXXXXXX)
+mkdir -p /srv/workspace/live-build
+export TMPDIR=$(mktemp --tmpdir /srv/workspace/live-build -d -t smallest-build.XXXXXXXX)
 cd ${TMPDIR}
 
 # Fetch and use the latest version of live build
@@ -229,6 +228,9 @@ if [ "$RESULT" != "0" ] ; then
    output_echo "Warning: lb config failed with $RESULT"
 fi
 
+# Re-activate the previous configuration
+lb config
+
 # Second build
 sudo lb build | tee -a $LB_OUTPUT
 RESULT=$?


=====================================
hosts/osuosl173-amd64/etc/sudoers.d/live-build
=====================================
@@ -2,3 +2,4 @@ Defaults env_keep += "SOURCE_DATE_EPOCH"
 Defaults env_keep += "LIVE_BUILD"
 jenkins ALL=(root) NOPASSWD: /usr/bin/lb build
 jenkins ALL=(root) NOPASSWD: /usr/bin/lb clean --purge
+jenkins ALL=(root) NOPASSWD: rm -rf --one-file-system /srv/workspace/live-build



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/31b0c6c5cbe9f204f442d54a4c639f43f21a384d

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/31b0c6c5cbe9f204f442d54a4c639f43f21a384d
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20210621/98f3db38/attachment-0001.htm>


More information about the Qa-jenkins-scm mailing list