mirror of
https://github.com/cachix/install-nix-action.git
synced 2024-11-22 08:30:51 +00:00
install-nix.sh: retry curl 5 times
If fetching the install script fails, don't keep the CI running forever.
This commit is contained in:
parent
21a5164e12
commit
802bde54e0
1 changed files with 7 additions and 1 deletions
|
@ -53,9 +53,15 @@ fi
|
||||||
echo "installer options: ${installer_options[*]}"
|
echo "installer options: ${installer_options[*]}"
|
||||||
|
|
||||||
# There is --retry-on-errors, but only newer curl versions support that
|
# There is --retry-on-errors, but only newer curl versions support that
|
||||||
until curl -o "$workdir/install" -v --fail --retry 5 --retry-connrefused -L "${INPUT_INSTALL_URL:-https://nixos.org/nix/install}"
|
curl_retries=5
|
||||||
|
while ! curl -o "$workdir/install" -v --fail -L "${INPUT_INSTALL_URL:-https://nixos.org/nix/install}"
|
||||||
do
|
do
|
||||||
sleep 1
|
sleep 1
|
||||||
|
((curl_retries--))
|
||||||
|
if [[ $curl_retries -le 0 ]]; then
|
||||||
|
echo "curl retries failed" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
sh "$workdir/install" "${installer_options[@]}"
|
sh "$workdir/install" "${installer_options[@]}"
|
||||||
|
|
Loading…
Reference in a new issue