[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] 3 commits: Use TMPDIR instead of MY_WORKSPACE, because call_diffoscope assumes

Holger Levsen (@holger) gitlab at salsa.debian.org
Mon Jun 21 11:05:52 BST 2021



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


Commits:
ffb6bdd9 by Roland Clobus at 2021-06-21T12:03:14+02:00
Use TMPDIR instead of MY_WORKSPACE, because call_diffoscope assumes
TMPDIR to be set

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

- - - - -
456664d6 by Roland Clobus at 2021-06-21T12:03:19+02:00
'lb clean --purge' requires root rights

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

- - - - -
02402977 by Holger Levsen at 2021-06-21T12:05:07+02:00
rb debian live: use safer and more common "rm -rf" syntax

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,13 +23,8 @@ output_echo() {
 
 cleanup() {
 	# Cleanup the workspace
-	if [ ! -z "${MY_WORKSPACE}" -a -d ${MY_WORKSPACE} ] ; then
-		rm -fr ${MY_WORKSPACE}
-	fi
-	# Cleanup the artifacts
-	if [ ! -z "${PROJECTNAME}" -a ! -z "${TMPDIR}" ] ; then
-		rm -fr $TMPDIR/b1/${PROJECTNAME}
-		rm -fr $TMPDIR/b2/${PROJECTNAME}
+	if [ ! -z "${TMPDIR}" ] ; then
+		rm -rf --one-file-system ${TMPDIR}
 	fi
 }
 
@@ -42,17 +37,17 @@ trap cleanup INT TERM EXIT
 
 # Generate and use an isolated workspace
 export PROJECTNAME="live-build"
-export MY_WORKSPACE=$(mktemp -d -t ${PROJECTNAME}.XXXXXXXX)
-cd ${MY_WORKSPACE}
+export TMPDIR=$(mktemp -d -t ${PROJECTNAME}.XXXXXXXX)
+cd ${TMPDIR}
 
 # Fetch and use the latest version of live build
-export LIVE_BUILD=${MY_WORKSPACE}/latest-live-build
+export LIVE_BUILD=${TMPDIR}/latest-live-build
 git clone https://salsa.debian.org/live-team/live-build.git ${LIVE_BUILD} --single-branch --no-tags
 pushd ${LIVE_BUILD}
 output_echo "Received git version $(git log -1 --pretty=oneline)"
 popd
 
-export LB_OUTPUT=${MY_WORKSPACE}/lb_output.txt
+export LB_OUTPUT=${TMPDIR}/lb_output.txt
 # Use 'now' as the basic timestamp
 export SOURCE_DATE_EPOCH=$(date +%s)
 
@@ -224,11 +219,11 @@ if [ "$RESULT" != "0" ] ; then
 fi
 
 # Move the image away
-mkdir -p $TMPDIR/b1/${PROJECTNAME}
-mv live-image-amd64.hybrid.iso $TMPDIR/b1/${PROJECTNAME}
+mkdir -p ${TMPDIR}/b1/${PROJECTNAME}
+mv live-image-amd64.hybrid.iso ${TMPDIR}/b1/${PROJECTNAME}
 
 # Clean for the second build
-lb clean --purge | tee -a $LB_OUTPUT
+sudo lb clean --purge | tee -a $LB_OUTPUT
 RESULT=$?
 if [ "$RESULT" != "0" ] ; then
    output_echo "Warning: lb config failed with $RESULT"
@@ -242,11 +237,11 @@ if [ "$RESULT" != "0" ] ; then
 fi
 
 # Move the image away
-mkdir -p $TMPDIR/b2/${PROJECTNAME}
-mv live-image-amd64.hybrid.iso $TMPDIR/b2/${PROJECTNAME}
+mkdir -p ${TMPDIR}/b2/${PROJECTNAME}
+mv live-image-amd64.hybrid.iso ${TMPDIR}/b2/${PROJECTNAME}
 
 # Clean up
-lb clean --purge | tee -a $LB_OUTPUT
+sudo lb clean --purge | tee -a $LB_OUTPUT
 RESULT=$?
 if [ "$RESULT" != "0" ] ; then
    output_echo "Warning: lb config failed with $RESULT"


=====================================
hosts/osuosl173-amd64/etc/sudoers.d/live-build
=====================================
@@ -1,3 +1,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



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/compare/5ce264f584356f102c95e91043db95ac176508c3...024029771978532d4c7349f6cf1c0c0c10ad612e

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/compare/5ce264f584356f102c95e91043db95ac176508c3...024029771978532d4c7349f6cf1c0c0c10ad612e
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/5506a5ad/attachment-0001.htm>


More information about the Qa-jenkins-scm mailing list