aboutsummaryrefslogtreecommitdiffstats
path: root/tool/travis_retry.sh
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2019-08-12 14:35:49 +0900
committerTakashi Kokubun <takashikkbn@gmail.com>2019-08-12 14:37:26 +0900
commitb1ef14176b3716e3900672a9563b94aa3abedb2d (patch)
treeb4901a6a9f550cd3105294b7d96b4c0439729d68 /tool/travis_retry.sh
parent4f10a61eaaf5bfe7e4c53edc79c5e27a7bd1ae33 (diff)
downloadruby-b1ef14176b3716e3900672a9563b94aa3abedb2d.tar.gz
We did not have tool/ before checkout
anyway we don't need authorization here. Also retry does not seem to work in the original version, so let's extend this with retries as a separate github action later.
Diffstat (limited to 'tool/travis_retry.sh')
-rwxr-xr-xtool/travis_retry.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/tool/travis_retry.sh b/tool/travis_retry.sh
new file mode 100755
index 0000000000..9b79c56550
--- /dev/null
+++ b/tool/travis_retry.sh
@@ -0,0 +1,13 @@
+#!/bin/sh -eu
+# The modified version of `travis_retry` to support custom backoffs, which is used by .travis.yml.
+# https://github.com/travis-ci/travis-build/blob/master/lib/travis/build/bash/travis_retry.bash
+
+for sleep in 0 ${WAITS:- 1 25 100}; do
+ sleep "$sleep"
+
+ echo "+ $@"
+ if "$@"; then
+ exit 0
+ fi
+done
+exit 1