Skip to content

Commit a8e030c

Browse files
committed
USHIFT-6218: Check brew access before downloading RPMs
1 parent c54db73 commit a8e030c

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

ci-operator/step-registry/openshift/microshift/infra/iso-build/openshift-microshift-infra-iso-build-commands.sh

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,20 @@ if [[ "${JOB_NAME}" =~ .*-cache.* ]] ; then
5454
if [ -e ./test/bin/manage_brew_rpms.sh ] && ./test/bin/manage_brew_rpms.sh -h | grep -q 'version_type' ; then
5555
y_version="$(cut -d'.' -f2 "${src_path}/Makefile.version.$(uname -m).var")"
5656
bash -x ./scripts/fetch_tools.sh brew
57-
# Fetch brew RPMs for release regression testing
58-
# Condition to skip it if manage_brew_rpms.sh script latest version is not backported to all release branches
59-
bash -x ./test/bin/manage_brew_rpms.sh download "4.${y_version}" "${out_path}" "zstream" || true
60-
bash -x ./test/bin/manage_brew_rpms.sh download "4.$((${y_version} - 1))" "${out_path}" "zstream" || true
57+
if ! ./test/bin/manage_brew_rpms.sh access; then
58+
echo "ERROR: Brew Hub site is not accessible"
59+
exit 1
60+
fi
61+
62+
LATEST_RELEASE_TYPE="$(awk -F= '/^LATEST_RELEASE_TYPE=/ {gsub(/[[:space:]"]/, "", $2); print $2}' ./test/bin/common_versions.sh)"
63+
if [[ -z "${LATEST_RELEASE_TYPE}" ]]; then
64+
LATEST_RELEASE_TYPE="ec"
65+
fi
66+
67+
# Download the appropriate release type RPMs for the current y_version
68+
bash -x ./test/bin/manage_brew_rpms.sh download "4.${y_version}" "${out_path}" "${LATEST_RELEASE_TYPE}" || true
6169
bash -x ./test/bin/manage_brew_rpms.sh download "4.$((${y_version} - 2))" "${out_path}" "zstream" || true
62-
bash -x ./test/bin/manage_brew_rpms.sh download "4.${y_version}" "${out_path}" "rc" || true
63-
bash -x ./test/bin/manage_brew_rpms.sh download "4.${y_version}" "${out_path}" "ec" || true
64-
bash -x ./test/bin/manage_brew_rpms.sh download "4.${y_version}" "${out_path}" "nightly" || true
70+
bash -x ./test/bin/manage_brew_rpms.sh download "4.$((${y_version} - 1))" "${out_path}" "zstream" || true
6571
fi
6672
popd &>/dev/null
6773
fi

0 commit comments

Comments
 (0)