diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2019-08-07 21:47:03 +0900 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2019-08-07 21:47:03 +0900 |
commit | 330e3f19c32dc6b0c287b7845c796e7e4a3ed575 (patch) | |
tree | b40e2551fdb7eb868005bb8f588bfc0e9323b6d7 /tool | |
parent | e6901cea741931906bacbb7c6afdafa621e50c0b (diff) | |
download | ruby-330e3f19c32dc6b0c287b7845c796e7e4a3ed575.tar.gz |
Refactor .travis.yml by introducing travis_retry.sh
Not using official travis_retry.bash, because it's not supporting to
modify backoff seconds.
https://github.com/travis-ci/travis-build/blob/0ad8f1886b2c31994d847e126dc5842b7b3513e3/lib/travis/build/bash/travis_retry.bash
Not using official `travis_apt_get_update` function because it does not
propagate exit status to be used by retries.
https://github.com/travis-ci/travis-build/blob/0ad8f1886b2c31994d847e126dc5842b7b3513e3/lib/travis/build/bash/travis_apt_get_update.bash
Co-Authored-By: Nobuyoshi Nakada <nobu@ruby-lang.org>
Diffstat (limited to 'tool')
-rwxr-xr-x | tool/travis_retry.sh | 13 |
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 |