You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2022/09/16 00:19:47 UTC
[activemq-artemis] 03/09: ARTEMIS-3981 bad docker image if release pull is 404
This is an automated email from the ASF dual-hosted git repository.
clebertsuconic pushed a commit to branch 2.x
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git
commit 799d5cc6c0924ddb2f17d4da0e8ed263635fd19e
Author: Justin Bertram <jb...@apache.org>
AuthorDate: Wed Sep 14 15:22:14 2022 -0500
ARTEMIS-3981 bad docker image if release pull is 404
(cherry picked from commit 015acab8db22395cac0326fa9b84421495abab13)
---
artemis-docker/prepare-docker.sh | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/artemis-docker/prepare-docker.sh b/artemis-docker/prepare-docker.sh
index efe12dbfc8..5289b6473b 100755
--- a/artemis-docker/prepare-docker.sh
+++ b/artemis-docker/prepare-docker.sh
@@ -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})" ]