From f51dc60970af3ae53126b5628ff2f1e4c480b17e Mon Sep 17 00:00:00 2001 From: Anil Belur Date: Sat, 23 Jan 2021 17:33:06 +1000 Subject: [PATCH] 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 --- releasenotes/notes/fix-release-job-script-edeb0473e2a9c7cb.yaml | 5 +++++ shell/release-job.sh | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/fix-release-job-script-edeb0473e2a9c7cb.yaml 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 -- 2.16.6