From: Anil Belur Date: Sat, 23 Jan 2021 07:33:06 +0000 (+1000) Subject: Fix release job script X-Git-Tag: v0.60.5~1^2 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=f51dc60970af3ae53126b5628ff2f1e4c480b17e;hp=-c;p=releng%2Fglobal-jjb.git Fix release job script Fix the release job script to handle LOG_DIR unbound variable and condition to check if the LOGS_SERVER or CDN_URL is being used. Issue: IT-21396 Change-Id: I3960a49aa12858af2ed4f47a1ec714ff793b70fd Signed-off-by: Anil Belur --- f51dc60970af3ae53126b5628ff2f1e4c480b17e diff --git a/releasenotes/notes/fix-release-job-script-edeb0473e2a9c7cb.yaml b/releasenotes/notes/fix-release-job-script-edeb0473e2a9c7cb.yaml new file mode 100644 index 00000000..dfb1b71c --- /dev/null +++ b/releasenotes/notes/fix-release-job-script-edeb0473e2a9c7cb.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fix the release job script to handle LOG_DIR unbound variable + and condition to check if the LOGS_SERVER or CDN_URL is being used. diff --git a/shell/release-job.sh b/shell/release-job.sh index 7ac6fc58..9ff67994 100644 --- a/shell/release-job.sh +++ b/shell/release-job.sh @@ -25,7 +25,7 @@ python -m pip freeze set_variables_common(){ echo "INFO: Setting common variables" - if [[ -z ${LOGS_SERVER:-} ]] || [[ -z ${CDN_URL:-} ]]; then + if [[ -z ${LOGS_SERVER:-} ]] && [[ -z ${CDN_URL:-} ]]; then echo "ERROR: LOGS_SERVER or CDN_URL not defined" exit 1 fi @@ -48,6 +48,9 @@ set_variables_common(){ release_file="None" fi + if [[ -z ${LOG_DIR:-} ]]; then + LOG_DIR=$(yq -r ".log_dir" "$release_file") + fi if [[ -n ${LOGS_SERVER:-} ]]; then logs_url="${LOGS_SERVER}/${NEXUS_PATH}${LOG_DIR}" elif [[ -n ${CDN_URL:-} ]]; then