From 22b444050047fcc1292edb33950a1749d0ab007b Mon Sep 17 00:00:00 2001 From: Anil Belur Date: Mon, 5 Aug 2019 08:55:50 +1000 Subject: [PATCH] Improve the release job script Change-Id: Ie62e2f3771632012423e0b791aca1551b4b31112 Signed-off-by: Anil Belur --- releasenotes/notes/fix-release-job-script-0179491d09b06e66.yaml | 5 +++++ shell/release-job.sh | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/fix-release-job-script-0179491d09b06e66.yaml diff --git a/releasenotes/notes/fix-release-job-script-0179491d09b06e66.yaml b/releasenotes/notes/fix-release-job-script-0179491d09b06e66.yaml new file mode 100644 index 00000000..c78c6e09 --- /dev/null +++ b/releasenotes/notes/fix-release-job-script-0179491d09b06e66.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fix the release job script to handle any trailing '/' set on log_dir + and also handle unbound variables correctly. diff --git a/shell/release-job.sh b/shell/release-job.sh index a0e6b448..d9880cd3 100644 --- a/shell/release-job.sh +++ b/shell/release-job.sh @@ -34,6 +34,7 @@ if [ "${LOGS_SERVER}" == 'None' ]; then exit 1 fi +NEXUSPROXY="${NEXUSPROXY:-None}" NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}" # Fetch the release-schema.yaml @@ -61,7 +62,8 @@ NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/" LOGS_URL="${LOGS_SERVER}/${NEXUS_PATH}${LOG_DIR}" PATCH_DIR="$(mktemp -d)" -wget --quiet -P "$PATCH_DIR" "${LOGS_URL}"staging-repo.txt.gz +LOGS_URL=${LOGS_URL%/} # strip any trailing '/' +wget -P "$PATCH_DIR" "${LOGS_URL}/"staging-repo.txt.gz nexus_release(){ for staging_url in $(zcat "$PATCH_DIR"/staging-repo.txt.gz | awk -e '{print $2}'); do -- 2.16.6