aboutsummaryrefslogtreecommitdiffstats
path: root/tool/ci_retry.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tool/ci_retry.sh')
-rwxr-xr-xtool/ci_retry.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/tool/ci_retry.sh b/tool/ci_retry.sh
new file mode 100755
index 0000000000..4eb378ad1a
--- /dev/null
+++ b/tool/ci_retry.sh
@@ -0,0 +1,15 @@
+#!/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
+#
+# Now this is also used by .github/workflow/*.yml.
+
+for sleep in 0 ${WAITS:- 1 25 100}; do
+ sleep "$sleep"
+
+ echo "+ $@"
+ if "$@"; then
+ exit 0
+ fi
+done
+exit 1