From 31dfe057f9b5667991f3c7809a13a87485f32ac6 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 6 Feb 2018 20:52:56 +0100 Subject: bin/ping-from-slave new --- bin/ping-from-slave | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 bin/ping-from-slave (limited to 'bin/ping-from-slave') diff --git a/bin/ping-from-slave b/bin/ping-from-slave new file mode 100755 index 0000000..4013269 --- /dev/null +++ b/bin/ping-from-slave @@ -0,0 +1,11 @@ +#!/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: acutally do something here :-) -- cgit v1.2.3-54-g00ecf From 28593a5108321b6c14262f96c322a3be12fee9ba Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 21 Mar 2018 11:16:22 +0100 Subject: bin/ping-from-slave: tell slave if build is still expected from him --- bin/ping-from-slave | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'bin/ping-from-slave') 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 -- cgit v1.2.3-54-g00ecf