From 6329c452fdc99013dd7539acfe5b7252163fc554 Mon Sep 17 00:00:00 2001 From: Anil Belur Date: Mon, 27 May 2019 11:21:12 +1000 Subject: [PATCH] Revert "Pass multiple pattern args in logs-deploy.sh" This reverts commit 2dcdf635f5b1d7feffa3af9fe4f15368a0f1ebe7. The change does not handle the case when the archive artifacts are empty. Change-Id: I0601254373777078f86834bf52bedb37fda6cb65 Signed-off-by: Anil Belur --- shell/logs-deploy.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/shell/logs-deploy.sh b/shell/logs-deploy.sh index f4b88690..23660d7a 100644 --- a/shell/logs-deploy.sh +++ b/shell/logs-deploy.sh @@ -10,9 +10,8 @@ ############################################################################## echo "---> logs-deploy.sh" -# Ensure we fail the job if any steps fail -# Disable 'globbing' -set -euf -o pipefail +# Ensure we fail the job if any steps fail. +set -eu -o pipefail if [[ -z $"${LOGS_SERVER:-}" ]]; then echo "WARNING: Logging server not set" @@ -21,13 +20,18 @@ else nexus_path="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}" # Handle multiple search extensions as separate values to '-p|--pattern' - # "arg1 arg2" -> (-p arg1 -p arg2) + set -f # Disable pathname expansion + search_exts=() + IFS=' ' read -r -a search_exts <<< "${ARCHIVE_ARTIFACTS:-}" pattern_opts=() - for arg in ${ARCHIVE_ARTIFACTS:-}; do - pattern_opts+=("-p" "$arg") + for search_ext in "${search_exts[@]:-}"; + do + pattern_opts+=("-p" "$search_ext") done + lftools deploy archives "${pattern_opts[@]}" "$nexus_url" "$nexus_path" \ "$WORKSPACE" + set +f # Enable pathname expansion lftools deploy logs "$nexus_url" "$nexus_path" "${BUILD_URL:-}" echo "Build logs: $LOGS_SERVER/$nexus_path" -- 2.16.6