From 5faa6abe7d27502ef05e873405276241d3bbeb6c Mon Sep 17 00:00:00 2001 From: Dibir Magomedsaygitov Date: Tue, 7 Jul 2020 19:23:45 +0300 Subject: [PATCH] implement download_with_retries function --- images/linux/scripts/helpers/install.sh | 4 ++-- images/linux/scripts/installers/oras-cli.sh | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/images/linux/scripts/helpers/install.sh b/images/linux/scripts/helpers/install.sh index 0843983ed..c61c2431d 100644 --- a/images/linux/scripts/helpers/install.sh +++ b/images/linux/scripts/helpers/install.sh @@ -14,9 +14,9 @@ download_with_retries() { local COMPRESSED="$4" if [ $COMPRESSED == "compressed" ]; then - COMMAND="curl $URL -4 -s --compressed -o '$DEST/$NAME'" + COMMAND="curl $URL -4 -sL --compressed -o '$DEST/$NAME'" else - COMMAND="curl $URL -4 -s -o '$DEST/$NAME'" + COMMAND="curl $URL -4 -sL -o '$DEST/$NAME'" fi echo "Downloading $URL..." diff --git a/images/linux/scripts/installers/oras-cli.sh b/images/linux/scripts/installers/oras-cli.sh index d23763ad0..02e3f0a1a 100644 --- a/images/linux/scripts/installers/oras-cli.sh +++ b/images/linux/scripts/installers/oras-cli.sh @@ -6,6 +6,7 @@ # Source the helpers for use with the script source $HELPER_SCRIPTS/document.sh +source $HELPER_SCRIPTS/install.sh # Determine latest ORAS CLI version ORAS_CLI_LATEST_VERSION_URL=https://api.github.com/repos/deislabs/oras/releases/latest @@ -14,7 +15,7 @@ ORAS_CLI_ARCHIVE=$(basename $ORAS_CLI_DOWNLOAD_URL) # Install ORAS CLI cd /tmp -curl -LO $ORAS_CLI_DOWNLOAD_URL -o $ORAS_CLI_ARCHIVE +download_with_retries $ORAS_CLI_DOWNLOAD_URL mkdir -p oras-install tar -xzvf $ORAS_CLI_ARCHIVE -C oras-install/ mv oras-install/oras /usr/local/bin/