Commit 1ab99eb2 authored by Holger Levsen's avatar Holger Levsen
Browse files

reproducible Debian: refactoring



Signed-off-by: Holger Levsen's avatarHolger Levsen <holger@layer-acht.org>
parent 40c48f0b
...@@ -24,11 +24,12 @@ cleanup() { ...@@ -24,11 +24,12 @@ cleanup() {
# Init some variables # Init some variables
export TOOL="mmdebstrap"
export SUITE="$1" export SUITE="$1"
export SOURCE_DATE_EPOCH="$(date +%s)" export SOURCE_DATE_EPOCH="$(date +%s)"
output_echo "SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH" output_echo "SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH"
export BUILDDIR=$(mktemp --tmpdir=/srv/workspace/ -d -t mmdebstrap-${SUITE}.XXXXXXXX) export BUILDDIR=$(mktemp --tmpdir=/srv/workspace/ -d -t ${TOOL}-${SUITE}.XXXXXXXX)
export RESULTSDIR=$(mktemp --tmpdir=/srv/reproducible-results -d -t mmdebstrap-${SUITE}.XXXXXXXX) # accessible in schroots, used to compare results export RESULTSDIR=$(mktemp --tmpdir=/srv/reproducible-results -d -t ${TOOL}-${SUITE}.XXXXXXXX) # accessible in schroots, used to compare results
# Cleanup if something goes wrong # Cleanup if something goes wrong
trap cleanup INT TERM EXIT trap cleanup INT TERM EXIT
...@@ -36,32 +37,32 @@ trap cleanup INT TERM EXIT ...@@ -36,32 +37,32 @@ trap cleanup INT TERM EXIT
# Randomize start time # Randomize start time
delay_start delay_start
# Actual run mmdebstrap twice # Actual run ${TOOL} twice
mkdir -p $BUILDDIR/b1/mmdebstrap mkdir -p $BUILDDIR/b1/${TOOL}
mkdir -p $BUILDDIR/b2/mmdebstrap mkdir -p $BUILDDIR/b2/${TOOL}
output_echo "Verbosely running mmdebstrap $SUITE for the first run." output_echo "Verbosely running ${TOOL} $SUITE for the first run."
sudo mmdebstrap -v $SUITE > $BUILDDIR/b1/mmdebstrap/${SUITE}.tar sudo ${TOOL} -v $SUITE > $BUILDDIR/b1/${TOOL}/${SUITE}.tar
output_echo "Running mmdebstrap $SUITE for the second run." output_echo "Running ${TOOL} $SUITE for the second run."
sudo mmdebstrap $SUITE > $BUILDDIR/b2/mmdebstrap/${SUITE}.tar sudo ${TOOL} $SUITE > $BUILDDIR/b2/${TOOL}/${SUITE}.tar
output_echo "Done running mmdebstrap twice." output_echo "Done running ${TOOL} twice."
# show sha256sum results # show sha256sum results
mv $BUILDDIR/b1 $BUILDDIR/b2 $RESULTSDIR/ 1>/dev/null mv $BUILDDIR/b1 $BUILDDIR/b2 $RESULTSDIR/ 1>/dev/null
sha256sum $RESULTSDIR/b1/mmdebstrap/${SUITE}.tar $RESULTSDIR/b2/mmdebstrap/${SUITE}.tar sha256sum $RESULTSDIR/b1/${TOOL}/${SUITE}.tar $RESULTSDIR/b2/${TOOL}/${SUITE}.tar
# show human readable results # show human readable results
if diff $RESULTSDIR/b1/mmdebstrap/${SUITE}.tar $RESULTSDIR/b2/mmdebstrap/${SUITE}.tar ; then if diff $RESULTSDIR/b1/${TOOL}/${SUITE}.tar $RESULTSDIR/b2/${TOOL}/${SUITE}.tar ; then
output_echo "Success: mmdebstrap of $SUITE is reproducible today." output_echo "Success: ${TOOL} of $SUITE is reproducible today."
else else
output_echo "Warning: mmdebstrap of $SUITE is not reproducible." output_echo "Warning: ${TOOL} of $SUITE is not reproducible."
# Run diffoscope on the images # Run diffoscope on the images
output_echo "Calling diffoscope on the results." output_echo "Calling diffoscope on the results."
TIMEOUT="240m" TIMEOUT="240m"
DIFFOSCOPE="$(schroot --directory /tmp -c chroot:jenkins-reproducible-${DBDSUITE}-diffoscope diffoscope -- --version 2>&1)" DIFFOSCOPE="$(schroot --directory /tmp -c chroot:jenkins-reproducible-${DBDSUITE}-diffoscope diffoscope -- --version 2>&1)"
TMPDIR=${RESULTSDIR} TMPDIR=${RESULTSDIR}
call_diffoscope mmdebstrap ${SUITE}.tar call_diffoscope ${TOOL} ${SUITE}.tar
fi fi
cleanup success cleanup success
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment