[Qa-jenkins-scm] [jenkins.debian.net] 01/01: reproducible: make live_status.html work nicely and run it every minute

Holger Levsen holger at moszumanska.debian.org
Thu Sep 10 20:13:34 UTC 2015


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 6a709d2382d6e73fa76b4a39e38ef844465ea2e2
Author: Holger Levsen <holger at layer-acht.org>
Date:   Thu Sep 10 22:12:51 2015 +0200

    reproducible: make live_status.html work nicely and run it every minute
---
 bin/reproducible_html_live_status.py | 28 ++++++++++++++--------------
 job-cfg/reproducible.yaml            |  2 +-
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/bin/reproducible_html_live_status.py b/bin/reproducible_html_live_status.py
index 3a899a5..d9f7488 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 += '<p><table class="scheduled">\n' + tab
+    html += '<p>If there are more than 21 rows shown here, the list includes stale builds... we\'re working on it. Stay tuned.<table class="scheduled">\n' + tab
     html += '<tr><th>#</th><th>src pkg id</th><th>name</th><th>version</th>'
     html += '<th>suite</th><th>arch</th><th>scheduled by</th>'
     html += '<th>scheduled on</th><th>build started</th><th>status</th>'
-    html += '<tr><th>version building</th><th>previous build duration</th><th>builder job</th><th>notify</th>'
+    html += '<th>version building</th><th>previous build duration</th><th>builder job</th><th>notify</th>'
     html += '</tr>\n'
     for row in rows:
         pkg = row[1]
         arch = row[4]
         suite = row[3]
-        html += tab + '<tr><td> </td><td>' + row[0] + '</td>'
+        html += tab + '<tr><td> </td><td>' + str(row[0]) + '</td>'
         html += '<td><code>'
         html += link_package(pkg, suite, arch)
-        html += '</code></td>'
-        html += '<td>' + row[1] + '</td><td>' + row[2] + '</td><td>' + row[3] + '</td>'
-        html += '<td>' + row[4] + '</td><td>' + row[5] + '</td><td>' + row[6] + '</td>'
-        html += '<td>' + row[7] + '</td><td>' + row[8] + '</td><td>' + row[9] + '</td>'
-        html += '<td>' + row[10] + '</td><td>' + row[11] + '</td><td>' + row[12] + '</td>'
+        html += '</code></td><td>' + str(row[2]) + '</td><td>' + str(row[3]) + '</td>'
+        html += '<td>' + str(row[4]) + '</td><td>' + str(row[5]) + '</td><td>' + str(row[6]) + '</td>'
+        html += '<td>' + str(row[7]) + '</td><td>' + str(row[8]) + '</td><td>' + str(row[9]) + '</td>'
+        html += '<td>' + str(row[10]) + '</td><td><a href="https://jenkins.debian.net/job/reproducible_builder_' + str(row[11]) + '/console">' + str(row[11]) + '</a></td><td>' + str(row[12]) + '</td>'
         html += '</tr>\n'
     html += '</table></p>\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()
 
diff --git a/job-cfg/reproducible.yaml b/job-cfg/reproducible.yaml
index 4e65390..52e9837 100644
--- a/job-cfg/reproducible.yaml
+++ b/job-cfg/reproducible.yaml
@@ -748,7 +748,7 @@
             my_node: ''
         - '{name}_html_live_status':
             my_description: 'Generate an HTML page showing the live status of all builds happening or scheduled by humans.'
-            my_timed: 'H/20 * * * *'    # should be H/2 once it works properly
+            my_timed: '* * * * *'
             my_shell: '/srv/jenkins/bin/reproducible_html_live_status.py'
             my_recipients: 'qa-jenkins-scm at lists.alioth.debian.org'
             my_node: ''

-- 
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