This is an automated email from the ASF dual-hosted git repository.

jbertram pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


The following commit(s) were added to refs/heads/main by this push:
     new c9f01cec3c ARTEMIS-3981 improve logic
c9f01cec3c is described below

commit c9f01cec3cd55ddbc6ddb4338643abd5a8fa0bc3
Author: Justin Bertram <[email protected]>
AuthorDate: Thu Sep 15 10:27:22 2022 -0500

    ARTEMIS-3981 improve logic
    
    Don't check the CDN URL twice in the case where it's good.
---
 artemis-docker/prepare-docker.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/artemis-docker/prepare-docker.sh b/artemis-docker/prepare-docker.sh
index 82b68b3646..1c3bff74ca 100755
--- a/artemis-docker/prepare-docker.sh
+++ b/artemis-docker/prepare-docker.sh
@@ -134,13 +134,13 @@ if [ -n "${FROM_RELEASE}" ]; then
   if [ -z "$(curl -Is ${ARTEMIS_BASE_URL}${ARTEMIS_DIST_FILE_NAME} | head -n 1 
| grep 200)" ]
   then
     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
+    # If the archive also 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
   fi
 
   if [ -z "$(ls -A ${BASE_TMPDIR}/${ARTEMIS_VERSION})" ]

Reply via email to