[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] 2 commits: refactoring

Holger Levsen (@holger) gitlab at salsa.debian.org
Fri Aug 26 19:15:12 BST 2022



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


Commits:
c520d79c by Holger Levsen at 2022-08-26T19:59:45+02:00
refactoring

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

- - - - -
1a4bf7a5 by Holger Levsen at 2022-08-26T20:14:50+02:00
reproducible Debian: new job to test reproducibility of mmdebstrap of unstable

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

- - - - -


5 changed files:

- bin/common-functions.sh
- bin/jenkins_node_wrapper.sh
- bin/reproducible_debian_live_build.sh
- + bin/reproducible_mmdebstrap.sh
- job-cfg/reproducible.yaml


Changes:

=====================================
bin/common-functions.sh
=====================================
@@ -214,6 +214,17 @@ write_page() {
 	echo "$1" >> $PAGE
 }
 
+output_echo() {
+	set +x
+	echo "###########################################################################################"
+	echo
+	echo -e "$(date -u) - $1"
+	echo
+	if $DEBUG; then
+		set -x
+	fi
+}
+
 jenkins_zombie_check() {
 	#
 	# sometimes deleted jobs come back as zombies


=====================================
bin/jenkins_node_wrapper.sh
=====================================
@@ -2,7 +2,7 @@
 # vim: set noexpandtab:
 
 # Copyright (c) 2009, 2010, 2012, 2015 Peter Palfrader
-#               2015-2021 Holger Levsen
+#               2015-2022 Holger Levsen
 #               2017-2018 Mattia Rizzolo <mattia at debian.org>
 #
 # Permission is hereby granted, free of charge, to any person obtaining
@@ -86,6 +86,8 @@ elif [ "$1" = "reproducible_pool_buildinfos" ] ; then
 	exec /srv/jenkins/bin/reproducible_pool_buildinfos.sh ; croak "Exec failed";
 elif [ "$1" = "reproducible_html_builtin-pho" ] ; then
 	exec /srv/jenkins/bin/reproducible_html_builtin-pho.sh ; croak "Exec failed";
+elif [ "$1" = "reproducible_mmdebstrap" ] ; then
+	exec /srv/jenkins/bin/reproducible_mmdebstrap.sh "$2" ; croak "Exec failed";
 elif [ "$1" = "janitor-setup-worker" ] ; then
 	shift ; exec /srv/jenkins/bin/janitor_setup_worker.sh ; croak "Exec failed";
 elif [ "$1" = "janitor-worker" ] ; then


=====================================
bin/reproducible_debian_live_build.sh
=====================================
@@ -16,17 +16,6 @@ common_init "$@"
 set -e
 set -o pipefail # see eg http://petereisentraut.blogspot.com/2010/11/pipefail.html
 
-output_echo() {
-	set +x
-	echo "###########################################################################################"
-	echo
-	echo -e "$(date -u) - $1"
-	echo
-	if $DEBUG; then
-		set -x
-	fi
-}
-
 # Copy a single file to the web server
 #
 # Argument 1 = description (one word)


=====================================
bin/reproducible_mmdebstrap.sh
=====================================
@@ -0,0 +1,58 @@
+#!/bin/bash
+# vim: set noexpandtab:
+
+# Copyright 2021-2022 Holger Levsen <holger at layer-acht.org>
+# released under the GPLv2
+
+DEBUG=false
+. /srv/jenkins/bin/common-functions.sh
+common_init "$@"
+
+# common code for tests.reproducible-builds.org
+. /srv/jenkins/bin/reproducible_common.sh
+set -e
+set -o pipefail # see eg http://petereisentraut.blogspot.com/2010/11/pipefail.html
+
+cleanup() {
+	local RESULT=$1
+	output_echo "Cleanup ${RESULT}"
+	# Cleanup the workspace
+	if [ ! -z "${BUILDDIR}" ]; then
+		sudo rm -rf --one-file-system ${BUILDDIR}
+	fi
+}
+
+
+# Init some variables
+export SUITE="$1"
+export SOURCE_DATE_EPOCH="$(date +%s)"
+export BUILDDIR=$(mktemp --tmpdir=/srv/workspace/ -d -t mmdebstrap-${SUITE}.XXXXXXXX)
+
+# Cleanup if something goes wrong
+trap cleanup INT TERM EXIT
+
+# Randomize start time
+delay_start
+
+# Actual run mmdebstrap twice
+mkdir $BUILDDIR/b1 $BUILDDIR/b2
+output_echo "Running mmdebstrap $SUITE for the first run."
+mmdebstrap $SUITE > $BUILDDIR/b1/mmdebstrap/${SUITE}.tar
+
+output_echo "Running mmdebstrap $SUITE for the second run."
+mmdebstrap $SUITE > $BUILDDIR/b2/mmdebstrap/${SUITE}.tar
+
+# 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=${BUILDDIR}
+call_diffoscope mmdebstrap ${SUITE}.tar
+
+cleanup success
+
+# Turn off the trap
+trap - INT TERM EXIT
+
+# We reached the end, return with PASS
+exit 0


=====================================
job-cfg/reproducible.yaml
=====================================
@@ -604,6 +604,11 @@
                 - 'create_meta_pkg_sets':
                     my_description: 'Create meta package sets for later consumption when generating HTML stats.'
                     my_timed: '0 6 * * H/3'
+                - 'mmdebstrap_unstable':
+                    my_shell: '/srv/jenkins/bin/reproducible_mmdebstrap.sh unstable'
+                    my_description: 'Check mmdebstrap of unstable is reproducible.'
+                    my_timed: '0 7 * * *'
+                    my_hname: 'osuosl173'
                 - 'json':
                     my_description: 'Generate https://reproducible.debian.net/userContent/reproducible.json for consumption by tracker.debian.org.'
                     my_timed: '1 H/2 * * *'



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/compare/afbd1d105b3c77d1e63058a52640a091dbc89ac0...1a4bf7a5c59d5b7d26afce51dde0bb86bd25503a

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/compare/afbd1d105b3c77d1e63058a52640a091dbc89ac0...1a4bf7a5c59d5b7d26afce51dde0bb86bd25503a
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/20220826/9e1879a9/attachment-0001.htm>


More information about the Qa-jenkins-scm mailing list