From 6a709d2382d6e73fa76b4a39e38ef844465ea2e2 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Thu, 10 Sep 2015 22:12:51 +0200 Subject: reproducible: make live_status.html work nicely and run it every minute --- bin/reproducible_html_live_status.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'bin') diff --git a/bin/reproducible_html_live_status.py b/bin/reproducible_html_live_status.py index 3a899a58..d9f74880 100755 --- a/bin/reproducible_html_live_status.py +++ b/bin/reproducible_html_live_status.py @@ -15,37 +15,37 @@ def generate_live_status(): 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;' + '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.date_build_started != "" OR p.notify != "" ' + \ + 'ORDER BY p.date_build_started, date_scheduled DESC' html = '' rows = query_db(query) - html += '

\n' + tab + html += '

If there are more than 21 rows shown here, the list includes stale builds... we\'re working on it. Stay tuned.

\n' + tab html += '' html += '' html += '' - html += '' + html += '' html += '\n' for row in rows: pkg = row[1] arch = row[4] suite = row[3] - html += tab + '' + html += tab + '' html += '' - html += '' - html += '' - html += '' - html += '' + html += '' + html += '' + html += '' + html += '' html += '\n' html += '
#src pkg idnameversionsuitearchscheduled byscheduled onbuild startedstatus
version buildingprevious build durationbuilder jobnotifyversion buildingprevious build durationbuilder jobnotify
 ' + row[0] + '
 ' + str(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] + '' + str(row[2]) + '' + str(row[3]) + '' + str(row[4]) + '' + str(row[5]) + '' + str(row[6]) + '' + str(row[7]) + '' + str(row[8]) + '' + str(row[9]) + '' + str(row[10]) + '' + str(row[11]) + '' + str(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) + log.info("Package page generated at " + desturl) if __name__ == '__main__': - generate_live_status + generate_live_status() -- cgit v1.2.3-70-g09d2