2020-10-23 17:59:08 +03:00
|
|
|
#!/bin/bash -e -o pipefail
|
2020-10-27 09:45:22 +03:00
|
|
|
source ~/utils/utils.sh
|
|
|
|
|
|
2020-09-10 14:34:08 +03:00
|
|
|
echo "Get the latest Stack version..."
|
2022-02-09 15:52:28 +03:00
|
|
|
stackDownloadUrl=$(get_github_package_download_url "commercialhaskell/stack" "contains(\"osx-x86_64.tar.gz\")" "latest" "$API_PAT")
|
2022-02-07 17:19:09 +03:00
|
|
|
stackVersion=$(echo $stackDownloadUrl | cut -d "/" -f8 | tr -d "v")
|
|
|
|
|
stackArchive="/tmp/stack.tar.gz"
|
2020-09-10 14:34:08 +03:00
|
|
|
|
2022-02-07 17:19:09 +03:00
|
|
|
echo "Download stack version $stackVersion..."
|
|
|
|
|
download_with_retries $stackDownloadUrl "/tmp" "stack.tar.gz"
|
2020-09-10 14:34:08 +03:00
|
|
|
|
2022-02-07 17:19:09 +03:00
|
|
|
stackToolcachePath="$AGENT_TOOLSDIRECTORY/stack/$stackVersion"
|
|
|
|
|
destinationPath="$stackToolcachePath/x64"
|
2020-09-10 14:34:08 +03:00
|
|
|
|
2022-02-07 17:19:09 +03:00
|
|
|
mkdir -p $destinationPath
|
2020-09-10 14:34:08 +03:00
|
|
|
|
|
|
|
|
echo "Unzip stack archive..."
|
2022-02-07 17:19:09 +03:00
|
|
|
tar -xzf $stackArchive -C $destinationPath --strip 1
|
2020-09-10 14:34:08 +03:00
|
|
|
|
2022-02-07 17:19:09 +03:00
|
|
|
touch $stackToolcachePath/x64.complete
|
2020-09-10 14:34:08 +03:00
|
|
|
|
2022-02-07 17:19:09 +03:00
|
|
|
echo "export PATH="\$PATH":$destinationPath" >> "$HOME/.bashrc"
|
2021-01-11 13:30:51 +07:00
|
|
|
|
|
|
|
|
invoke_tests "Common" "Stack"
|