Resolve #1736: Retry fetching stack thrice
This commit is contained in:
parent
4d0e46d6fd
commit
76d1e13fcc
1 changed files with 20 additions and 7 deletions
|
@ -2,16 +2,29 @@
|
|||
|
||||
set -eux
|
||||
|
||||
mkdir -p ~/.local/bin;
|
||||
if [ `uname` = "Darwin" ]; then
|
||||
curl -kL https://www.stackage.org/stack/osx-x86_64 | tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin;
|
||||
else
|
||||
curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack';
|
||||
fi;
|
||||
stack --no-terminal setup;
|
||||
travis_retry() {
|
||||
cmd=$*
|
||||
$cmd || (sleep 2 && $cmd) || (sleep 10 && $cmd)
|
||||
}
|
||||
|
||||
fetch_stack_osx() {
|
||||
curl -skL https://www.stackage.org/stack/osx-x86_64 | tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin;
|
||||
}
|
||||
|
||||
fetch_stack_linux() {
|
||||
curl -sL https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack';
|
||||
}
|
||||
|
||||
case "$BUILD" in
|
||||
stack)
|
||||
mkdir -p ~/.local/bin;
|
||||
if [ `uname` = "Darwin" ]; then
|
||||
travis_retry fetch_stack_osx
|
||||
else
|
||||
travis_retry fetch_stack_linux
|
||||
fi;
|
||||
|
||||
travis_retry stack --no-terminal setup;
|
||||
;;
|
||||
cabal)
|
||||
mkdir -p $HOME/.cabal
|
||||
|
|
Loading…
Reference in a new issue