Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/ping-from-slave
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2018-03-23 20:18:01 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2018-03-23 20:18:01 +0100
commitc30de005f885202f24929bd4e3d3f5c885efbc0a (patch)
tree44b512356b80d3adad6521ad74f38ff9271f6c0d /bin/ping-from-slave
parentff768f012bfef1bf264d06214aead70a58c0ff90 (diff)
parent497779257683e1c4ee2f2bf4c25687b34323c6be (diff)
Merge branch 'master' into opcodes
Diffstat (limited to 'bin/ping-from-slave')
-rwxr-xr-xbin/ping-from-slave25
1 files changed, 25 insertions, 0 deletions
diff --git a/bin/ping-from-slave b/bin/ping-from-slave
new file mode 100755
index 0000000..afaf018
--- /dev/null
+++ b/bin/ping-from-slave
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# should be called periodically on the build-master from the slaves to
+# - report any update on the build process
+# - show that the build is still running
+# - get notified by the build master if the build is not necessary anymore
+
+# shellcheck source=conf/default.conf
+. "${0%/*}/../conf/default.conf"
+
+# TODO: receive/save some statistics about current build
+
+if [ "$(
+ # shellcheck disable=SC2016,SC2154
+ {
+ printf 'SELECT count(*) FROM `build_slaves`'
+ mysql_join_build_slaves_build_assignments
+ printf ' WHERE `build_slaves`.`name`=from_base64("%s");\n' \
+ "$(printf '%s' "${slave}" | base64 -w0)"
+ } | \
+ mysql_run_query
+ )" -ne 1 ]; then
+ >&2 echo 'You do not build anything currently - abort whatever you are doing.'
+ exit 2
+fi