From 5d88af462f4d5ff5936717df1199aa28baa891ae Mon Sep 17 00:00:00 2001 From: Tom Jefferson Date: Thu, 13 Jan 2022 16:31:54 +0000 Subject: [PATCH] Only lookup level if prereqs met (#197) --- travis-build-scripts/build.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/travis-build-scripts/build.sh b/travis-build-scripts/build.sh index 9823760..df3723e 100755 --- a/travis-build-scripts/build.sh +++ b/travis-build-scripts/build.sh @@ -26,6 +26,14 @@ get_archive_level() { level_path="${archive_level_cache_dir}/${archive_variable}.level" if [[ ! -f "$level_path" ]]; then + if [[ -z "${REPOSITORY_USER}" || -z "${REPOSITORY_CREDENTIALS}" ]]; then + echo 'Skipping level lookup as repository credentials not set' + return + fi + if [[ -z "${!archive_variable}" ]]; then + echo "Skipping level lookup as '\$${archive_variable}' is not set" + return + fi ./travis-build-scripts/artifact-util.sh -f "${!archive_variable}" -u "${REPOSITORY_USER}" -p "${REPOSITORY_CREDENTIAL}" -l "$level_path" -n snapshot --get-property fi read -r MQ_ARCHIVE_LEVEL < "$level_path"