aboutsummaryrefslogtreecommitdiffstats
path: root/tool/ci_retry.sh
blob: 4eb378ad1a0e37bb598ae2aff7a80b84a0babee2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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