From 6f9e4790d92e5eb1ecccb6d88ad41ef79d2f55e9 Mon Sep 17 00:00:00 2001 From: Patryk Matuszak Date: Fri, 14 Jun 2024 15:30:40 +0200 Subject: [PATCH] If RHOCP is not available, try using RHOCP mirror --- test/bin/build_images.sh | 20 +++++++++++++++++++- test/package-sources/rhocp-y.toml | 9 +++++++++ test/package-sources/rhocp-y1.toml | 9 +++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/test/bin/build_images.sh b/test/bin/build_images.sh index 8cf5b90e0a..17b57e7660 100755 --- a/test/bin/build_images.sh +++ b/test/bin/build_images.sh @@ -81,6 +81,8 @@ configure_package_sources() { export RHOCP_MINOR_Y export RHOCP_MINOR_Y1 export RHOCP_MINOR_Y2 + export RHOCP_MINOR_Y_BETA + export RHOCP_MINOR_Y1_BETA # Add our sources. It is OK to run these steps repeatedly, if the # details change they are updated in the service. @@ -571,6 +573,15 @@ is_rhocp_available() { return 1 } +is_rhocp_beta_available() { + local -r ver="${1}" + url="https://mirror.openshift.com/pub/openshift-v4/${UNAME_M}/dependencies/rpms/4.${ver}-el9-beta/" + if sudo dnf -v repository-packages --disablerepo '*' --repofrompath "this,${url}" this info cri-o 1>&2; then + return 0 + fi + return 1 +} + usage() { if [ $# -gt 0 ] ; then echo "ERROR: $*" @@ -712,12 +723,19 @@ PREVIOUS_RELEASE_VERSION=$(echo "${previous_version_repo}" | cut -d, -f1) PREVIOUS_RELEASE_REPO=$(echo "${previous_version_repo}" | cut -d, -f2) RHOCP_MINOR_Y="" -RHOCP_MINOR_Y1="" +RHOCP_MINOR_Y_BETA="" if is_rhocp_available "${MINOR_VERSION}"; then RHOCP_MINOR_Y="${MINOR_VERSION}" +elif is_rhocp_beta_available "${MINOR_VERSION}"; then + RHOCP_MINOR_Y_BETA="https://mirror.openshift.com/pub/openshift-v4/${UNAME_M}/dependencies/rpms/4.${MINOR_VERSION}-el9-beta/" fi + +RHOCP_MINOR_Y1="" +RHOCP_MINOR_Y1_BETA="" if is_rhocp_available "${PREVIOUS_MINOR_VERSION}"; then RHOCP_MINOR_Y1="${PREVIOUS_MINOR_VERSION}" +elif is_rhocp_beta_available "${PREVIOUS_MINOR_VERSION}"; then + RHOCP_MINOR_Y1_BETA="https://mirror.openshift.com/pub/openshift-v4/${UNAME_M}/dependencies/rpms/4.${PREVIOUS_MINOR_VERSION}-el9-beta/" fi # For Y-2, there will always be a real repository, so we can always diff --git a/test/package-sources/rhocp-y.toml b/test/package-sources/rhocp-y.toml index d3dbf6b283..97e397e695 100644 --- a/test/package-sources/rhocp-y.toml +++ b/test/package-sources/rhocp-y.toml @@ -8,3 +8,12 @@ check_ssl = true system = false rhsm = true {{- end -}} +{{- if env.Getenv "RHOCP_MINOR_Y_BETA" "" -}} +id = "rhocp-y" +name = "rhocp BETA" +type = "yum-baseurl" +url = "{{ .Env.RHOCP_MINOR_Y_BETA }}" +check_gpg = false +check_ssl = true +system = false +{{- end -}} diff --git a/test/package-sources/rhocp-y1.toml b/test/package-sources/rhocp-y1.toml index 14554badc9..75decc64d4 100644 --- a/test/package-sources/rhocp-y1.toml +++ b/test/package-sources/rhocp-y1.toml @@ -8,3 +8,12 @@ check_ssl = true system = false rhsm = true {{- end -}} +{{- if env.Getenv "RHOCP_MINOR_Y1_BETA" "" -}} +id = "rhocp-y1" +name = "rhocp Y-1 BETA" +type = "yum-baseurl" +url = "{{ .Env.RHOCP_MINOR_Y1_BETA }}" +check_gpg = false +check_ssl = true +system = false +{{- end -}}