[Qa-jenkins-scm] [jenkins.debian.net] 01/01: reproducible debian: create page with oldest logs

Holger Levsen holger at layer-acht.org
Sun May 29 15:10:51 UTC 2016


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit 4e0555f5806d57a5ec244a5d84d82597d5e17e56
Author: Holger Levsen <holger at layer-acht.org>
Date:   Sun May 29 17:10:34 2016 +0200

    reproducible debian: create page with oldest logs
---
 bin/reproducible_html_dashboard.sh   |  6 +++++-
 bin/reproducible_html_live_status.py | 35 +++++++++++++++++++++++++++++++++--
 2 files changed, 38 insertions(+), 3 deletions(-)

diff --git a/bin/reproducible_html_dashboard.sh b/bin/reproducible_html_dashboard.sh
index 0897f64..acb3b6a 100755
--- a/bin/reproducible_html_dashboard.sh
+++ b/bin/reproducible_html_dashboard.sh
@@ -591,7 +591,11 @@ create_performance_page() {
 		write_page "</p><p style=\"clear:both;\">"
 	done
 	# the end
-	write_page "Daily <a href=\"https://jenkins.debian.net/view/reproducible/job/reproducible_nodes_info/lastBuild/console\">individual build node performance stats</a> are available too.</p>"
+	write_page "Daily <a href=\"https://jenkins.debian.net/view/reproducible/job/reproducible_nodes_info/lastBuild/console\">individual build node performance stats</a> are available as well as views of oldest results for"
+	for ARCH in ${ARCHS} ; do
+		write_page " <a href=\"/index_${ARCH}_oldies.html\">$ARCH</a>"
+	done
+	write_page ".</p>"
 	write_page_footer
 	publish_page
 }
diff --git a/bin/reproducible_html_live_status.py b/bin/reproducible_html_live_status.py
index 07224d9..2fe6b6b 100755
--- a/bin/reproducible_html_live_status.py
+++ b/bin/reproducible_html_live_status.py
@@ -1,7 +1,7 @@
 #!/usr/bin/python3
 # -*- coding: utf-8 -*-
 #
-# Copyright © 2015 Holger Levsen <holger at layer-acht.org>
+# Copyright © 2015-2016 Holger Levsen <holger at layer-acht.org>
 # based on ~jenkins.d.n:~mattia/status.sh by Mattia Rizzolo <mattia at mapreri.org>
 # Licensed under GPL-2
 #
@@ -37,7 +37,7 @@ def generate_schedule(arch):
     html += generate_live_status_table(arch)
     html += '<p><table class="scheduled">\n' + tab
     html += '<tr><th class="center">#</th><th class="center">scheduled at</th><th class="center">suite</th>'
-    html += '<th class="center">arch</th><th class="center">source package</th><th class="center">previous build status</th><th class="center">previous build duration</th><th class="center">average build duration</th></tr>n'
+    html += '<th class="center">arch</th><th class="center">source package</th><th class="center">previous build status</th><th class="center">previous build duration</th><th class="center">average build duration</th></tr>\n'
     bugs = get_bugs()
     for row in rows:
         # 0: date_scheduled, 1: suite, 2: arch, 3: pkg name 4: previous status 5: previous build duration 6. avg build duration
@@ -95,7 +95,38 @@ def generate_live_status_table(arch):
     html += '</table></p>\n'
     return html
 
+def generate_oldies(arch):
+    log.info('Building the oldies page for ' + arch + '...')
+    title = 'Oldest results on ' + arch
+    html = ''
+    for suite in SUITES:
+        query = 'SELECT s.suite, s.architecture, s.name, r.status, r.build_date ' + \
+                'FROM results AS r JOIN sources AS s ON r.package_id=s.id ' + \
+                'WHERE s.suite="{suite}" AND s.architecture="{arch}" ' + \
+                'AND r.status != "blacklisted" ' + \
+                'ORDER BY r.build_date LIMIT 15'
+        text = Template('Oldest results on $suite/$arch:')
+        rows = query_db(query.format(arch=arch,suite=suite))
+        html += build_leading_text_section({'text': text}, rows, suite, arch)
+        html += '<p><table class="scheduled">\n' + tab
+        html += '<tr><th class="center">#</th><th class="center">suite</th><th class="center">arch</th>'
+        html += '<th class="center">source package</th><th class="center">status</th><th class="center">build date</th></tr>\n'
+        bugs = get_bugs()
+        for row in rows:
+            # 0: suite, 1: arch, 2: pkg name 3: status 4: build date
+            pkg = row[2]
+            html += tab + '<tr><td> </td><td>' + row[0] + '</td>'
+            html += '<td>' + row[1] + '</td><td><code>'
+            html += link_package(pkg, row[0], row[1], bugs)
+            html += '</code></td><td>'+convert_into_status_html(str(row[3]))+'</td><td>' + row[4] + '</td></tr>\n'
+        html += '</table></p>\n'
+    destfile = BASE + '/index_' + arch + '_oldies.html'
+    desturl = REPRODUCIBLE_URL + '/index_' + arch + '_oldies.html'
+    write_html_page(title=title, body=html, destfile=destfile, arch=arch, style_note=True, refresh_every=60)
+    log.info("Page generated at " + desturl)
+
 if __name__ == '__main__':
     for arch in ARCHS:
         generate_schedule(arch)
+        generate_oldies(arch)
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list