change wget and curl to retry functions

This commit is contained in:
Mikhail Timofeev
2020-10-27 09:45:22 +03:00
parent 48e266a55a
commit 592fcf2f66
9 changed files with 64 additions and 9 deletions

View File

@@ -1,5 +1,7 @@
#!/bin/bash -e -o pipefail
source ~/utils/utils.sh
echo "Get the latest Stack version..."
StackRelease=$(curl -s "https://api.github.com/repos/commercialhaskell/stack/releases/latest")
DownloadUrl=$(echo $StackRelease | jq -r '.assets[].browser_download_url | select(contains("osx-x86_64.tar.gz"))' | head -n 1)
@@ -7,7 +9,7 @@ StackVersion=$(echo $StackRelease | jq -r '.name' | cut -c2-)
StackArchive="/tmp/stack.tar.gz"
echo "Download stack version $StackVersion..."
wget $DownloadUrl -O $StackArchive
download_with_retries $DownloadUrl "/tmp" "stack.tar.gz"
StackToolcachePath="$AGENT_TOOLSDIRECTORY/stack/$StackVersion"
DestinationPath="$StackToolcachePath/x64"