Skip to content

Commit 5d88af4

Browse files
JEFFLUFCGitHub Enterprise
authored andcommitted
Only lookup level if prereqs met (#197)
1 parent eff6ded commit 5d88af4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

travis-build-scripts/build.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ get_archive_level() {
2626
level_path="${archive_level_cache_dir}/${archive_variable}.level"
2727

2828
if [[ ! -f "$level_path" ]]; then
29+
if [[ -z "${REPOSITORY_USER}" || -z "${REPOSITORY_CREDENTIALS}" ]]; then
30+
echo 'Skipping level lookup as repository credentials not set'
31+
return
32+
fi
33+
if [[ -z "${!archive_variable}" ]]; then
34+
echo "Skipping level lookup as '\$${archive_variable}' is not set"
35+
return
36+
fi
2937
./travis-build-scripts/artifact-util.sh -f "${!archive_variable}" -u "${REPOSITORY_USER}" -p "${REPOSITORY_CREDENTIAL}" -l "$level_path" -n snapshot --get-property
3038
fi
3139
read -r MQ_ARCHIVE_LEVEL < "$level_path"

0 commit comments

Comments
 (0)