mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-15 22:36:46 +00:00
implement download_with_retries function
This commit is contained in:
@@ -14,9 +14,9 @@ download_with_retries() {
|
|||||||
local COMPRESSED="$4"
|
local COMPRESSED="$4"
|
||||||
|
|
||||||
if [ $COMPRESSED == "compressed" ]; then
|
if [ $COMPRESSED == "compressed" ]; then
|
||||||
COMMAND="curl $URL -4 -s --compressed -o '$DEST/$NAME'"
|
COMMAND="curl $URL -4 -sL --compressed -o '$DEST/$NAME'"
|
||||||
else
|
else
|
||||||
COMMAND="curl $URL -4 -s -o '$DEST/$NAME'"
|
COMMAND="curl $URL -4 -sL -o '$DEST/$NAME'"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Downloading $URL..."
|
echo "Downloading $URL..."
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
# Source the helpers for use with the script
|
# Source the helpers for use with the script
|
||||||
source $HELPER_SCRIPTS/document.sh
|
source $HELPER_SCRIPTS/document.sh
|
||||||
|
source $HELPER_SCRIPTS/install.sh
|
||||||
|
|
||||||
# Determine latest ORAS CLI version
|
# Determine latest ORAS CLI version
|
||||||
ORAS_CLI_LATEST_VERSION_URL=https://api.github.com/repos/deislabs/oras/releases/latest
|
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
|
# Install ORAS CLI
|
||||||
cd /tmp
|
cd /tmp
|
||||||
curl -LO $ORAS_CLI_DOWNLOAD_URL -o $ORAS_CLI_ARCHIVE
|
download_with_retries $ORAS_CLI_DOWNLOAD_URL
|
||||||
mkdir -p oras-install
|
mkdir -p oras-install
|
||||||
tar -xzvf $ORAS_CLI_ARCHIVE -C oras-install/
|
tar -xzvf $ORAS_CLI_ARCHIVE -C oras-install/
|
||||||
mv oras-install/oras /usr/local/bin/
|
mv oras-install/oras /usr/local/bin/
|
||||||
|
|||||||
Reference in New Issue
Block a user