[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] Cleanup RESULTSDIR when safe; publish results; unify whitespace

Holger Levsen (@holger) gitlab at salsa.debian.org
Fri Jun 25 17:35:01 BST 2021



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


Commits:
1006e099 by Roland Clobus at 2021-06-25T18:34:42+02:00
Cleanup RESULTSDIR when safe; publish results; unify whitespace

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

- - - - -


1 changed file:

- bin/reproducible_debian_live_build.sh


Changes:

=====================================
bin/reproducible_debian_live_build.sh
=====================================
@@ -15,17 +15,19 @@ set -e
 set -o pipefail		# see eg http://petereisentraut.blogspot.com/2010/11/pipefail.html
 
 output_echo() {
-	echo "###########################################################################################"
-	echo
-	echo -e "$(date -u) - $1"
-	echo
+   echo "###########################################################################################"
+   echo
+   echo -e "$(date -u) - $1"
+   echo
 }
 
 cleanup() {
-	# Cleanup the workspace
-	sudo rm -rf --one-file-system /srv/workspace/live-build
-	# Cleanup the results
-	rm -rf --one-file-system /srv/reproducible-results/live-build-*
+   # Cleanup the workspace
+   sudo rm -rf --one-file-system /srv/workspace/live-build
+   # Cleanup the results
+   if [ ! -z "${RESULTSDIR}" ] ; then
+      rm -rf --one-file-system ${RESULTSDIR}
+   fi
 }
 
 #
@@ -262,13 +264,17 @@ DIFFOSCOPE="$(schroot --directory /tmp -c chroot:jenkins-reproducible-${DBDSUITE
 TMPDIR=${RESULTSDIR}
 call_diffoscope ${PROJECTNAME} ${CONFIGURATION}/live-image-amd64.hybrid.iso
 # List the content of the results directory
-tree ${RESULTSDIR}
-if [ ! -f "${RESULTSDIR}/${PROJECTNAME}/${CONFIGURATION}/live-image-amd64.hybrid.iso.html" ] ; then
-   output_echo "Error: diffoscope failed, no output available"
+PAGE=${CONFIGURATION}.html
+if [ -f "${RESULTSDIR}/${PROJECTNAME}/${CONFIGURATION}/live-image-amd64.hybrid.iso.html" ] ; then
+   # Publish the output of diffoscope, there are differences
+   cp -a ${RESULTSDIR}/${PROJECTNAME}/${CONFIGURATION}/live-image-amd64.hybrid.iso.html ${PAGE}
+else
+   if [ "$RESULT" != "0" ] ; then
+      echo "${DIFFOSCOPE} for ${PROJECTNAME} in configuration ${CONFIGURATION} returned error code ${RESULT}" > ${PAGE}
+   else
+      echo "${PROJECTNAME} in configuration ${CONFIGURATION} is reproducible" > ${PAGE}
+   fi
 fi
-# Publish the output of diffoscope
-PAGE=live-image-amd64.hybrid.iso.html
-cp -a ${RESULTSDIR}/${PROJECTNAME}/${CONFIGURATION}/live-image-amd64.hybrid.iso.html ${PAGE}
 publish_page debian_live_build
 
 cleanup success



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

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/1006e099295ae2fa3dbef303d4fff75b3b5a5282
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/20210625/6f572e21/attachment-0001.htm>


More information about the Qa-jenkins-scm mailing list