mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-14 22:09:26 +00:00
Fix download retry helper (#1110)
* Fix download helper * Fix download helper * Add compressed flag to helper * Minor fix * Minor fix
This commit is contained in:
committed by
GitHub
parent
4d685f4b01
commit
c1ee9d8bc6
@@ -11,12 +11,19 @@ download_with_retries() {
|
||||
local URL="$1"
|
||||
local DEST="${2:-.}"
|
||||
local NAME="${3:-${URL##*/}}"
|
||||
local COMPRESSED="$4"
|
||||
|
||||
if [ $COMPRESSED == "compressed" ]; then
|
||||
COMMAND="curl $URL -4 -s --compressed -o '$DEST/$NAME'"
|
||||
else
|
||||
COMMAND="curl $URL -4 -s -o '$DEST/$NAME'"
|
||||
fi
|
||||
|
||||
echo "Downloading $URL..."
|
||||
i=20
|
||||
while [ $i -gt 0 ]; do
|
||||
((i--))
|
||||
curl $URL -4 -s -compressed -o "$DEST/$NAME"
|
||||
eval $COMMAND
|
||||
if [ $? != 0 ]; then
|
||||
sleep 30
|
||||
else
|
||||
|
||||
@@ -72,7 +72,7 @@ function InstallPyPy
|
||||
|
||||
# Installation PyPy
|
||||
uri="https://downloads.python.org/pypy/"
|
||||
download_with_retries $uri "/tmp" "pypyUrls.html"
|
||||
download_with_retries $uri "/tmp" "pypyUrls.html" compressed
|
||||
pypyVersions="$(cat /tmp/pypyUrls.html | grep 'linux64' | awk -v uri="$uri" -F'>|<' '{print uri$5}')"
|
||||
|
||||
toolsetJson="$INSTALLER_SCRIPT_FOLDER/toolset.json"
|
||||
|
||||
Reference in New Issue
Block a user