Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/build-master-status-from-mysql
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-01-17 14:09:21 +0100
committerErich Eckner <git@eckner.net>2018-01-17 14:09:21 +0100
commitecc46adbdc33951bb8e683e9d46c4771e1d35704 (patch)
treea864dc33b273f932efa35738a523eff0515c34ad /bin/build-master-status-from-mysql
parent5af79738e3849ea31f05476a201c3e77bc202c7d (diff)
bin/build-master-status-from-mysql new
Diffstat (limited to 'bin/build-master-status-from-mysql')
-rwxr-xr-xbin/build-master-status-from-mysql30
1 files changed, 30 insertions, 0 deletions
diff --git a/bin/build-master-status-from-mysql b/bin/build-master-status-from-mysql
new file mode 100755
index 0000000..9626b27
--- /dev/null
+++ b/bin/build-master-status-from-mysql
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# report about status of build master - according to mysql database
+
+# shellcheck source=conf/default.conf
+. "${0%/*}/../conf/default.conf"
+# shellcheck source=bin/mysql-functions
+. "${base_dir}/bin/mysql-functions"
+
+# shellcheck disable=SC2016
+${mysql_command} '
+ SELECT `build_slaves`.`name`,`build_slaves`.`operator`,`package_sources`.`pkgbase`,`build_slaves`.`last_connection`
+ FROM `build_slaves`
+ LEFT JOIN `build_assignments` ON
+ `build_slaves`.`currently_building`=`build_assignments`.`id`
+ LEFT JOIN `package_sources` ON
+ `build_assignments`.`package_source`=`package_sources`.`id`
+' --html | \
+ sed '
+ s,</TR>,\0\n,g
+ ' | \
+ sed '
+ \,</TH></TR>$, {
+ s,<TH>pkgbase</TH>,<TH>currently building</TH>,
+ y,_, ,
+ }
+ 1 i <html><head><title>list of build slaves</title></head><body>
+ $ a </body></html>
+ ' > \
+ "${webserver_directory}/build-slaves.html"