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>
--- /dev/null
+---
+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.
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
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