[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] 3 commits: reproducible_debian_live_build: Use DESKTOP and SUITE
Holger Levsen (@holger)
gitlab at salsa.debian.org
Wed Sep 14 22:18:20 BST 2022
Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net
Commits:
97a407e3 by Roland Clobus at 2022-09-14T23:14:06+02:00
reproducible_debian_live_build: Use DESKTOP and SUITE
Signed-off-by: Holger Levsen <holger at layer-acht.org>
- - - - -
6229aa04 by Roland Clobus at 2022-09-14T23:17:34+02:00
reproducible_debian_live_build: Do not call diffoscope if the checksum is identical
Signed-off-by: Holger Levsen <holger at layer-acht.org>
- - - - -
037654da by Roland Clobus at 2022-09-14T23:17:41+02:00
reproducible_debian_live_build: If the archive is updated during the second build, both builds need to be regenerated
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
=====================================
@@ -38,9 +38,9 @@ cleanup() {
output_echo "Info: no differences found."
# Upload the ISO file and its summary to the web server
- ISONAME=${CONFIGURATION}-${DEBIAN_VERSION}.iso
- publish_file ISOfile ${RESULTSDIR}/b1/${PROJECTNAME}/${CONFIGURATION}/live-image-amd64.hybrid.iso ${ISONAME}
- publish_file Summary ${RESULTSDIR}/summary_build1.txt ${CONFIGURATION}-${DEBIAN_VERSION}.txt
+ ISONAME=${DESKTOP}-${SUITE}.iso
+ publish_file ISOfile ${RESULTSDIR}/b1/${PROJECTNAME}/${DESKTOP}/live-image-amd64.hybrid.iso ${ISONAME}
+ publish_file Summary ${RESULTSDIR}/summary_build1.txt ${DESKTOP}-${SUITE}.txt
# Invoke openQA
OPEN_QA_CLI="schroot --directory $TMPDIR -c source:jenkins-reproducible-unstable-diffoscope -- openqa-cli"
@@ -60,14 +60,14 @@ cleanup() {
;;
esac
else
- if [ -f "${RESULTSDIR}/${PROJECTNAME}/${CONFIGURATION}/live-image-amd64.hybrid.iso.html" ]; then
+ if [ -f "${RESULTSDIR}/${PROJECTNAME}/${DESKTOP}/live-image-amd64.hybrid.iso.html" ]; then
# Publish the output of diffoscope, there are differences
output_echo "Publishing the output of diffoscope, there are differences."
- publish_file DiffoscopeOutput ${RESULTSDIR}/${PROJECTNAME}/${CONFIGURATION}/live-image-amd64.hybrid.iso.html ${CONFIGURATION}-${DEBIAN_VERSION}.html
+ publish_file DiffoscopeOutput ${RESULTSDIR}/${PROJECTNAME}/${DESKTOP}/live-image-amd64.hybrid.iso.html ${DESKTOP}-${SUITE}.html
else
output_echo "Error: Something went wrong."
printenv >environment.txt
- publish_file Environment ${PWD}/environment.txt ${CONFIGURATION}-${DEBIAN_VERSION}.txt
+ publish_file Environment ${PWD}/environment.txt ${DESKTOP}-${SUITE}.txt
fi
fi
@@ -89,19 +89,19 @@ cleanup() {
delay_start
# Argument 1 = image type
-export CONFIGURATION="$1"
+export DESKTOP="$1"
# Argument 2 = Debian version
-export DEBIAN_VERSION="$2"
+export SUITE="$2"
# Two arguments are required
-if [ -z "${CONFIGURATION}" -o -z "${DEBIAN_VERSION}" ]; then
+if [ -z "${DESKTOP}" -o -z "${SUITE}" ]; then
output_echo "Error: Bad command line arguments."
exit 1
fi
-output_echo "Info: Building Debian live-build for $CONFIGURATION / $DEBIAN_VERSION"
+output_echo "Info: Building Debian live-build for $DESKTOP / $SUITE"
-# Configuration option: Select the server for the repository
+# DESKTOP option: Select the server for the repository
# Allowed values:
# auto (default): Detect the best available server
# snapshot (preferred): Use a snapshot server
@@ -138,9 +138,9 @@ fi
# Generate and use an isolated workspace
export PROJECTNAME="live-build"
mkdir -p /srv/workspace/live-build
-export BUILDDIR=$(mktemp --tmpdir=/srv/workspace/live-build -d -t ${CONFIGURATION}-${DEBIAN_VERSION}.XXXXXXXX)
+export BUILDDIR=$(mktemp --tmpdir=/srv/workspace/live-build -d -t ${DESKTOP}-${SUITE}.XXXXXXXX)
cd ${BUILDDIR}
-export RESULTSDIR=$(mktemp --tmpdir=/srv/reproducible-results -d -t ${PROJECTNAME}-${CONFIGURATION}-${DEBIAN_VERSION}-XXXXXXXX) # accessible in schroots, used to compare results
+export RESULTSDIR=$(mktemp --tmpdir=/srv/reproducible-results -d -t ${PROJECTNAME}-${DESKTOP}-${SUITE}-XXXXXXXX) # accessible in schroots, used to compare results
# Fetch the rebuild script (and nothing else)
output_echo "Fetching the rebuild script."
@@ -184,8 +184,8 @@ else
fi
# Move the image away
-mkdir -p ${RESULTSDIR}/b1/${PROJECTNAME}/${CONFIGURATION}
-mv live-image-amd64.hybrid.iso ${RESULTSDIR}/b1/${PROJECTNAME}/${CONFIGURATION}
+mkdir -p ${RESULTSDIR}/b1/${PROJECTNAME}/${DESKTOP}
+mv live-image-amd64.hybrid.iso ${RESULTSDIR}/b1/${PROJECTNAME}/${DESKTOP}
mv summary.txt ${RESULTSDIR}/summary_build1.txt
# Second build
@@ -197,24 +197,26 @@ set -e
if [ "${SNAPSHOT_TIMESTAMP}" == "archive" ]; then
if [ ${RETURNVALUE} -eq 99 ]; then
- # The archive was updated while building. The content might not be consistent.
- # Discard the first build and retry
+ # The archive was updated while building.
+ # This is unfortunate, another two (!) builds are required
+ # Discard both builds and retry
output_echo "Info: during the second build the archive was updated, now trying again."
- mv live-image-amd64.hybrid.iso ${RESULTSDIR}/b1/${PROJECTNAME}/${CONFIGURATION}
+ rebuild_script/test/rebuild.sh "$1" "$2" "${SNAPSHOT_TIMESTAMP}"
+ mv live-image-amd64.hybrid.iso ${RESULTSDIR}/b1/${PROJECTNAME}/${DESKTOP}
mv summary.txt ${RESULTSDIR}/summary_build1.txt
rebuild_script/test/rebuild.sh "$1" "$2" "${SNAPSHOT_TIMESTAMP}"
- elif [ $(stat ${RESULTSDIR}/b1/${PROJECTNAME}/${CONFIGURATION}/live-image-amd64.hybrid.iso live-image-amd64.hybrid.iso | grep Modify: | uniq | wc -l) -ne 1 ]; then
+ elif [ $(stat ${RESULTSDIR}/b1/${PROJECTNAME}/${DESKTOP}/live-image-amd64.hybrid.iso live-image-amd64.hybrid.iso | grep Modify: | uniq | wc -l) -ne 1 ]; then
# The timestamps are different. Discard the first build and retry
output_echo "Info: between the builds the archive was updated, now trying again."
- mv live-image-amd64.hybrid.iso ${RESULTSDIR}/b1/${PROJECTNAME}/${CONFIGURATION}
+ mv live-image-amd64.hybrid.iso ${RESULTSDIR}/b1/${PROJECTNAME}/${DESKTOP}
mv summary.txt ${RESULTSDIR}/summary_build1.txt
rebuild_script/test/rebuild.sh "$1" "$2" "${SNAPSHOT_TIMESTAMP}"
fi
fi
# Move the image away
-mkdir -p ${RESULTSDIR}/b2/${PROJECTNAME}/${CONFIGURATION}
-mv live-image-amd64.hybrid.iso ${RESULTSDIR}/b2/${PROJECTNAME}/${CONFIGURATION}
+mkdir -p ${RESULTSDIR}/b2/${PROJECTNAME}/${DESKTOP}
+mv live-image-amd64.hybrid.iso ${RESULTSDIR}/b2/${PROJECTNAME}/${DESKTOP}
mv summary.txt ${RESULTSDIR}/summary_build2.txt
# Clean up
@@ -224,13 +226,14 @@ sudo lb clean --purge
# The workspace is no longer required
cd ..
-# Run diffoscope on the images
-output_echo "Calling diffoscope on the results."
-# FIXME: only do this if the md5 checksums of both images are different, this will save a lot of time if they are the same
-TIMEOUT="240m"
-DIFFOSCOPE="$(schroot --directory /tmp -c chroot:jenkins-reproducible-${DBDSUITE}-diffoscope diffoscope -- --version 2>&1)"
-TMPDIR=${RESULTSDIR}
-call_diffoscope ${PROJECTNAME} ${CONFIGURATION}/live-image-amd64.hybrid.iso
+if [ $(cat ${RESULTSDIR}/summary_build1.txt ${RESULTSDIR}/summary_build2.txt | grep Checksum: | uniq | wc -l) -ne 1 ]; then
+ # The checksums are different. Run diffoscope on the images
+ output_echo "Calling diffoscope on the results."
+ TIMEOUT="240m"
+ DIFFOSCOPE="$(schroot --directory /tmp -c chroot:jenkins-reproducible-${DBDSUITE}-diffoscope diffoscope -- --version 2>&1)"
+ TMPDIR=${RESULTSDIR}
+ call_diffoscope ${PROJECTNAME} ${DESKTOP}/live-image-amd64.hybrid.iso
+fi
cleanup success
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/compare/2bfa4ae7237aef2b6a88bd4bce77abb267d686f9...037654da08a78e3d04a0254f34dca991a8e9b413
--
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/compare/2bfa4ae7237aef2b6a88bd4bce77abb267d686f9...037654da08a78e3d04a0254f34dca991a8e9b413
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/20220914/157bffa9/attachment-0001.htm>
More information about the Qa-jenkins-scm
mailing list