Skip to content

Commit ebbdbc8

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

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

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

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,21 @@ 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
61-
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
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}" || echo "WARNING: Failed to download ${LATEST_RELEASE_TYPE} RPMs for 4.${y_version}"
69+
bash -x ./test/bin/manage_brew_rpms.sh download "4.${y_version}" "${out_path}" "nightly" || echo "WARNING: Failed to download nightly RPMs for 4.${y_version}"
70+
bash -x ./test/bin/manage_brew_rpms.sh download "4.$((${y_version} - 2))" "${out_path}" "zstream" || echo "WARNING: Failed to download zstream RPMs for 4.$((${y_version} - 2))"
71+
bash -x ./test/bin/manage_brew_rpms.sh download "4.$((${y_version} - 1))" "${out_path}" "zstream" || echo "WARNING: Failed to download zstream RPMs for 4.$((${y_version} - 1))"
6572
fi
6673
popd &>/dev/null
6774
fi

0 commit comments

Comments
 (0)