summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-03-21 11:16:22 +0100
committerErich Eckner <git@eckner.net>2018-03-21 11:16:22 +0100
commit28593a5108321b6c14262f96c322a3be12fee9ba (patch)
tree0bd16d2e8b0c7485de079533e42809a1fd064637
parent944da1b00e72f35fd758951a7b25bbb61f43b9fb (diff)
downloadbuilder-28593a5108321b6c14262f96c322a3be12fee9ba.tar.xz
bin/ping-from-slave: tell slave if build is still expected from him
-rwxr-xr-xbin/ping-from-slave16
1 files changed, 15 insertions, 1 deletions
diff --git a/bin/ping-from-slave b/bin/ping-from-slave
index 4013269..afaf018 100755
--- a/bin/ping-from-slave
+++ b/bin/ping-from-slave
@@ -8,4 +8,18 @@
# shellcheck source=conf/default.conf
. "${0%/*}/../conf/default.conf"
-# TODO: acutally do something here :-)
+# 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