From 94033b39cec1b0d4e0c6d9f25f82a5563fc8c58c Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Thu, 10 Sep 2015 21:41:57 +0200 Subject: reproducible: add new page, live_status.html --- bin/reproducible_html_live_status.py | 52 ++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100755 bin/reproducible_html_live_status.py (limited to 'bin') diff --git a/bin/reproducible_html_live_status.py b/bin/reproducible_html_live_status.py new file mode 100755 index 00000000..97ea8edc --- /dev/null +++ b/bin/reproducible_html_live_status.py @@ -0,0 +1,52 @@ +#!/usr/bin/python3 +# -*- coding: utf-8 -*- +# +# Copyright © 2015 Holger Levsen +# based on ~jenkins.d.n:~mattia/status.sh by Mattia Rizzolo +# Licensed under GPL-2 +# +# Depends: python3 +# + +from reproducible_common import * + +def generate_live_status(): + """ the schedule pages are very different than others index pages """ + log.info('Building live status page...') + title = 'Live status of reproducible.debian.net' + query = 'SELECT s.id, s.name, s.version, s.suite, s.architecture AS arch, ' + \ + 'p.scheduler, p.date_scheduled as "scheduled on", p.date_build_started AS "build started on", ' + \ + 'r.status, r.version, r.build_duration AS duration, p.builder, p.notify' + \ + 'FROM sources AS s JOIN schedule AS p ON p.package_id=s.id LEFT JOIN results AS r ON s.id=r.package_id' + \ + 'WHERE p.scheduler != "" OR p.date_build_started != "" OR p.notify != ""' + \ + 'ORDER BY date_scheduled desc;' + html = '' + rows = query_db(query) + html += '

\n' + tab + html += '' + html += '' + html += '' + html += '' + html += '\n' + for row in rows: + pkg = row[1] + arch = row[4] + suite = row[3] + url = RB_PKG_URI + '/' + suite + '/' + arch + '/' + pkg + '.html' + html += tab + '' + html += '' + html += '' + html += '' + html += '' + html += '' + html += '\n' + html += '
#src pkg idnameversionsuitearchscheduled byscheduled onbuild startedstatus
version buildingprevious build durationbuilder jobnotify
 ' + row[0] + '' + html += link_package(pkg, suite, arch) + html += '' + row[1] + '' + row[2] + '' + row[3] + '' + row[4] + '' + row[5] + '' + row[6] + '' + row[7] + '' + row[8] + '' + row[9] + '' + row[10] + '' + row[11] + '' + row[12] + '

\n' + destfile = BASE + '/live_status.html' + desturl = REPRODUCIBLE_URL + '/live_status.html' + write_html_page(title=title, body=html, destfile=destfile, style_note=True) + +if __name__ == '__main__': + generate_live_status + -- cgit v1.2.3-54-g00ecf