[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] reproducible Debian: new job to create html pages showing data from bremner's builtin-pho db

Holger Levsen gitlab at salsa.debian.org
Wed Feb 26 23:06:59 GMT 2020



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


Commits:
fbff618d by Holger Levsen at 2020-02-27T00:06:20+01:00
reproducible Debian: new job to create html pages showing data from bremner's builtin-pho db

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

- - - - -


3 changed files:

- bin/jenkins_node_wrapper.sh
- + bin/reproducible_html_builtin-pho.sh
- job-cfg/reproducible.yaml


Changes:

=====================================
bin/jenkins_node_wrapper.sh
=====================================
@@ -2,7 +2,7 @@
 # vim: set noexpandtab:
 
 # Copyright (c) 2009, 2010, 2012, 2015 Peter Palfrader
-#               2015-2018 Holger Levsen
+#               2015-2020 Holger Levsen
 #               2017-2018 Mattia Rizzolo <mattia at debian.org>
 #
 # Permission is hereby granted, free of charge, to any person obtaining
@@ -81,6 +81,8 @@ elif [ "$*" = "reproducible_nodes_info" ] ; then
 	exec /srv/jenkins/bin/reproducible_info.sh ; croak "Exec failed";
 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 ; croak "Exec failed";
 elif [ "$1" = "haskell-package-plan" ] ; then
 	shift ; exec /srv/jenkins/bin/chroot-run.sh $@ ; croak "Exec failed";
 elif [ "$1" = "/srv/jenkins/bin/reproducible_build.sh" ] && ( [ "$2" = "1" ] || [ "$2" = "2" ] ) ; then


=====================================
bin/reproducible_html_builtin-pho.sh
=====================================
@@ -0,0 +1,69 @@
+#!/bin/bash
+# vim: set noexpandtab:
+
+# Copyright 2020 Holger Levsen <holger at layer-acht.org>
+# released under the GPLv2
+
+DEBUG=false
+. /srv/jenkins/bin/common-functions.sh
+common_init "$@"
+
+# common code defining db access
+. /srv/jenkins/bin/reproducible_common.sh
+
+#
+# Many thanks to David Bremner for https://salsa.debian.org/bremner/builtin-pho.git
+# on which this relies.
+#
+
+query_builtin_pho_db() {
+	if [ "$SUITE" = "unstable" ] ; then
+		local SUITE="sid"
+	else
+		local SUITE=$SUITE
+	fi
+ 
+	psql buildinfo <<EOF > $DUMMY_FILE
+select distinct p.source,p.version
+from
+      binary_packages p
+where
+      p.suite="$SUITE"
+except
+        select p.source,p.version
+from binary_packages p, builds b
+where
+      b.source=p.source
+      and p.version=b.version
+      and ( (b.arch_all and p.arch="all") or
+            (b.arch_$SUITE and p.arch="$ARCH") )
+EOF
+}
+
+#
+# create buildinfo stats page
+#
+create_buildinfo_page() {
+	VIEW=buildinfo
+	PAGE=index_${VIEW}.html
+	echo "$(date -u) - starting to write $PAGE page for $SUITE/$ARCH."
+	write_page_header $VIEW "Overview of various statistics about .buildinfo files for $SUITE/$ARCH"
+	query_builtin_pho_db
+	write_page "<pre>"
+	cat $DUMMY_FILE > $PAGE
+	write_page "</pre>"
+	# the end
+	write_page_footer
+	publish_page debian/$ARCH
+}
+
+#
+# main
+#
+DUMMY_FILE=$(mktemp -t reproducible-builtin-pho-XXXXXXXX)
+for ARCH in ${ARCHS} ; do
+	for SUITE in $SUITES ; do
+		create_buildinfo_page
+	done
+done
+rm -f $DUMMY_FILE


=====================================
job-cfg/reproducible.yaml
=====================================
@@ -531,6 +531,11 @@
                 - 'html_dashboard':
                     my_description: 'Generate HTML dashboard with graphs for reproducible builds.'
                     my_timed: '1 * * * *'
+                - 'html_builtin-pho':
+                    my_description: 'Generate HTML pages for stats about .buildinfo files based on builtin-pho data.'
+                    my_timed: '10 * * * *'
+                    my_shell: '/srv/jenkins/bin/jenkins_master_wrapper.sh'
+                    my_hname: 'profitbricks7'
                 - 'html_pkg_sets':
                     my_description: 'Generate HTML results (package sets with graphs) for reproducible builds.'
                     my_timed: '45 */2 * * *'



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

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/fbff618d69aed5b85a8367ebb712964e07e550fc
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/20200226/346aa394/attachment-0001.html>


More information about the Qa-jenkins-scm mailing list