diff options
author | Erich Eckner <git@eckner.net> | 2018-09-26 09:57:33 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-09-26 09:57:33 +0200 |
commit | 2aade49a60639dc0f99280e0ab6ffe92a967f53b (patch) | |
tree | 0b54b2d6668aa59af7eb10ac4b70b32b72de9b15 /bin | |
parent | 20ad7b8c89a6a0d53a15ecb8f5d7be5676fd8b5c (diff) | |
download | builder-2aade49a60639dc0f99280e0ab6ffe92a967f53b.tar.xz |
bin/slave-build-connect: extract name of operator, too
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/slave-build-connect | 15 |
1 files changed, 11 insertions, 4 deletions
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 |