Fix release job script 97/66597/1
authorAnil Belur <abelur@linuxfoundation.org>
Sat, 23 Jan 2021 07:33:06 +0000 (17:33 +1000)
committerAnil Belur <abelur@linuxfoundation.org>
Sat, 23 Jan 2021 07:33:06 +0000 (17:33 +1000)
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 <abelur@linuxfoundation.org>
releasenotes/notes/fix-release-job-script-edeb0473e2a9c7cb.yaml [new file with mode: 0644]
shell/release-job.sh

diff --git a/releasenotes/notes/fix-release-job-script-edeb0473e2a9c7cb.yaml b/releasenotes/notes/fix-release-job-script-edeb0473e2a9c7cb.yaml
new file mode 100644 (file)
index 0000000..dfb1b71
--- /dev/null
@@ -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.
index 7ac6fc5..9ff6799 100644 (file)
@@ -25,7 +25,7 @@ python -m pip freeze
 
 set_variables_common(){
     echo "INFO: Setting common variables"
 
 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
         echo "ERROR: LOGS_SERVER or CDN_URL not defined"
         exit 1
     fi
@@ -48,6 +48,9 @@ set_variables_common(){
         release_file="None"
     fi
 
         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
     if [[ -n ${LOGS_SERVER:-} ]]; then
         logs_url="${LOGS_SERVER}/${NEXUS_PATH}${LOG_DIR}"
     elif [[ -n ${CDN_URL:-} ]]; then