ARTEMIS-3981 bad docker image if release pull is 404

This commit is contained in:
Justin Bertram 2022-09-14 15:22:14 -05:00
parent abeed34449
commit 015acab8db
No known key found for this signature in database
GPG Key ID: F41830B875BB8633
1 changed files with 11 additions and 2 deletions

View File

@ -124,14 +124,23 @@ if [ -n "${FROM_RELEASE}" ]; then
cleanup
ARTEMIS_BASE_URL="$(curl -s https://www.apache.org/dyn/closer.cgi\?preferred=true)activemq/activemq-artemis/${ARTEMIS_VERSION}/"
CDN="$(curl -s https://www.apache.org/dyn/closer.cgi\?preferred=true)activemq/activemq-artemis/${ARTEMIS_VERSION}/"
ARCHIVE="https://archive.apache.org/dist/activemq/activemq-artemis/${ARTEMIS_VERSION}/"
ARTEMIS_BASE_URL=CDN
ARTEMIS_DIST_FILE_NAME="apache-artemis-${ARTEMIS_VERSION}-bin.tar.gz"
CURL_OUTPUT="${BASE_TMPDIR}/${ARTEMIS_VERSION}/${ARTEMIS_DIST_FILE_NAME}"
# Fallback to the Apache archive if the version doesn't exist on the CDN anymore
if [ -z "$(curl -Is ${ARTEMIS_BASE_URL}${ARTEMIS_DIST_FILE_NAME} | head -n 1 | grep 200)" ]
then
ARTEMIS_BASE_URL="https://archive.apache.org/dist/activemq/activemq-artemis/${ARTEMIS_VERSION}/"
ARTEMIS_BASE_URL=ARCHIVE
fi
# If the CDN doesn't work then report the failure and abort
if [ -z "$(curl -Is ${ARTEMIS_BASE_URL}${ARTEMIS_DIST_FILE_NAME} | head -n 1 | grep 200)" ]
then
echo "Failed to download ${ARTEMIS_DIST_FILE_NAME}. Tried both ${CDN} and ${ARCHIVE}."
exit 1
fi
if [ -z "$(ls -A ${BASE_TMPDIR}/${ARTEMIS_VERSION})" ]