Add a DCGI for NetBSD daily snapshot builds status - gophercgis - Collection of gopher CGI/DCGI for geomyidae
(HTM) hg clone https://bitbucket.org/iamleot/gophercgis
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) changeset 42eb67a5078934d328255a9de21cb614cef4a71d
(DIR) parent 70b909bd9bc3eea1393a4e97ec4887d60b303d06
(HTM) Author: Leonardo Taccari <iamleot@gmail.com>
Date: Wed, 6 Mar 2019 15:59:14
Add a DCGI for NetBSD daily snapshot builds status
Diffstat:
netbsd/builds.dcgi | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 59 insertions(+), 0 deletions(-)
---
diff -r 70b909bd9bc3 -r 42eb67a50789 netbsd/builds.dcgi
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/netbsd/builds.dcgi Wed Mar 06 15:59:14 2019 +0100
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+. ../common/config.sh
+
+
+#
+# Parse the <table> containing builds status information
+#
+filter_table()
+{
+
+ awk '
+ /<th class="tag"/ {
+ if (match($0, />[^<]+<\/th>/)) {
+ tag = substr($0, RSTART + 1, RLENGTH - 6)
+ }
+ }
+ /<td><a/ {
+ if (match($0, />[^<]+<\/a>/)) {
+ date = substr($0, RSTART + 1, RLENGTH - 5)
+ }
+ }
+ /<td class="totals">/ {
+ if (match($0, />[^<]+<\/td>/)) {
+ totals = substr($0, RSTART + 1, RLENGTH - 6)
+ }
+ }
+ /<td class="(partial|good)">/ {
+ if (match($0, />[^<]+<\/td>/)) {
+ passes = substr($0, RSTART + 1, RLENGTH - 6)
+ }
+ }
+ /<td class="(fails|all-ok)">/ {
+ if (match($0, />[^<]+<\/td>/)) {
+ fails = substr($0, RSTART + 1, RLENGTH - 6)
+ }
+ }
+ /<td class="build-time">/ {
+ if (match($0, />[^<]+<\/td>/)) {
+ build_time = substr($0, RSTART + 1, RLENGTH - 6)
+ }
+ }
+
+ tag && date && totals && passes && fails && build_time {
+ printf("t%12s | %s | %2d | %2d | %2d | %s\n",
+ tag, date, totals, passes, fails, build_time)
+ date = totals = passes = fails = build_time = ""
+ }
+ '
+
+}
+
+echo ""
+echo "NetBSD daily snapshot builds status"
+echo ""
+
+url="http://releng.NetBSD.org/cgi-bin/builds.cgi"
+curl -Lgs -- "${url}" |
+ filter_table