@@ -68,6 +68,50 @@ get_vrel_from_rpm() {{
6868 echo " "
6969}}
7070
71+ get_redhat_bootc_image_url () {{
72+ local -r registry=" $1 "
73+ local -r release_version=" $2 "
74+ local image_url=" "
75+
76+ # get arch
77+ local arch=" "
78+ case ${{UNAME_M} } in
79+ x86_64)
80+ arch=" amd64"
81+ ;;
82+ aarch64)
83+ arch=" arm64"
84+ ;;
85+ esac
86+
87+ sha_id=$( skopeo inspect --raw " docker://${{registry} }/openshift4/microshift-bootc-rhel9:v${{release_version} }" | \
88+ jq -r " .manifests[] | select(.platform.architecture==\" ${{arch} }\" ) | .digest" 2> /dev/null)
89+ if [ " ${{sha_id} }" ] && [[ " ${{sha_id} }" != " " ]] && [[ " ${{sha_id} }" =~ ^sha256:[0-9a-f]{{64}}$ ]]; then
90+ image_url=" registry.redhat.io/openshift4/microshift-bootc-rhel9@${{sha_id} }"
91+ fi
92+ echo " ${{image_url} }"
93+ }}
94+
95+ get_lrel_release_image_url () {{
96+ local -r release_type=" $1 "
97+ local -r release_version=" $2 "
98+ local image_url=" "
99+
100+ if [[ " ${{release_type} }" == " ec" ]]; then
101+ image_url=" https://mirror.openshift.com/pub/openshift-v4/${{UNAME_M} }/microshift/ocp-dev-preview/${{release_version} }/el9/os"
102+ elif [[ " ${{release_type} }" == " rc" ]]; then
103+ image_url=" https://mirror.openshift.com/pub/openshift-v4/${{UNAME_M} }/microshift/ocp/${{release_version} }/el9/os"
104+ elif [[ " ${{release_type} }" == " zstream" ]]; then
105+ for registry in " registry.redhat.io" " registry.stage.redhat.io" ; do
106+ image_url=" $( get_redhat_bootc_image_url " ${{registry} }" " ${{release_version} }" ) "
107+ if [ -n " ${{image_url} }" ]; then
108+ break
109+ fi
110+ done
111+ fi
112+ echo " ${{image_url} }"
113+ }}
114+
71115# The current release minor version (e.g. '17' for '4.17') affects
72116# the definition of previous and fake next versions.
73117export MINOR_VERSION={minor_version}
@@ -155,12 +199,16 @@ export BREW_RC_RELEASE_VERSION
155199export BREW_EC_RELEASE_VERSION
156200export BREW_NIGHTLY_RELEASE_VERSION
157201
158- # Set the release type to ec, rc or zstream
159- LATEST_RELEASE_TYPE=" {LATEST_RELEASE_TYPE}"
160- export LATEST_RELEASE_TYPE
202+ # Latest Release info
203+ LATEST_RELEASE_TYPE=" ec" # ec, rc or zstream
204+ BREW_LREL_RELEASE_VERSION=" ${{BREW_EC_RELEASE_VERSION} }" # BREW_EC_RELEASE_VERSION, BREW_RC_RELEASE_VERSION or BREW_Y0_RELEASE_VERSION
205+ LATEST_RELEASE_VERSION=" $( echo " ${{BREW_LREL_RELEASE_VERSION} }" | sed -E ' s/(.*)-.*/\1/' | sed -E ' s/(.*)~(.*)/\1-\2/' ) " # example: 4.19.7 or 4.20.0-rc.3
206+ LREL_RELEASE_IMAGE_URL=" $( get_lrel_release_image_url " ${{LATEST_RELEASE_TYPE} }" " ${{LATEST_RELEASE_VERSION} }" ) "
161207
162- BREW_LREL_RELEASE_VERSION= " ${{BREW_EC_RELEASE_VERSION} } "
208+ export LATEST_RELEASE_TYPE
163209export BREW_LREL_RELEASE_VERSION
210+ export LATEST_RELEASE_VERSION
211+ export LREL_RELEASE_IMAGE_URL
164212
165213# Branch and commit for the openshift-tests-private repository
166214OPENSHIFT_TESTS_PRIVATE_REPO_BRANCH=" release-4.${{MINOR_VERSION} }"
0 commit comments