From 2aade49a60639dc0f99280e0ab6ffe92a967f53b Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 26 Sep 2018 09:57:33 +0200 Subject: bin/slave-build-connect: extract name of operator, too --- bin/slave-build-connect | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'bin/slave-build-connect') diff --git a/bin/slave-build-connect b/bin/slave-build-connect index aadf4df..46f9351 100755 --- a/bin/slave-build-connect +++ b/bin/slave-build-connect @@ -19,9 +19,14 @@ if [ "x${SSH_ORIGINAL_COMMAND%% *}" = 'xget-assignment' ] || \ fi # shellcheck disable=SC2016 - slave_id=$( + infos=$( { - printf 'SELECT `build_slaves`.`id` FROM `build_slaves`' + printf 'SELECT' + printf ' `build_slaves`.`id`,' + printf ' `persons`.`name`' + printf ' FROM `build_slaves`' + mysql_join_build_slaves_ssh_keys + mysql_join_ssh_keys_persons printf ' WHERE `build_slaves`.`name`=from_base64("%s");\n' \ "$( printf '%s' "$1" | \ @@ -30,10 +35,12 @@ if [ "x${SSH_ORIGINAL_COMMAND%% *}" = 'xget-assignment' ] || \ } | \ mysql_run_query ) - if [ -z "${slave_id}" ]; then + if [ -z "${infos}" ]; then >&2 printf 'Build slave "%s" is unnknown to the database.\n' "$1" exit 42 fi + slave_id="${infos%% *}" + operator="${infos#* }" # shellcheck disable=SC2016 { @@ -53,7 +60,7 @@ if [ "x${SSH_ORIGINAL_COMMAND%% *}" = 'xget-assignment' ] || \ } | \ mysql_run_query 'unimportant' - slave="$1" slave_id="${slave_id}" /bin/sh -c "${base_dir}/bin/${SSH_ORIGINAL_COMMAND}" + slave="$1" slave_id="${slave_id}" operator="${operator}" /bin/sh -c "${base_dir}/bin/${SSH_ORIGINAL_COMMAND}" else -- cgit v1.2.3-70-g09d2