If you want to use travis_retry
from within your own shell script files then you first have to make the travis_retry
shell function available by sourcing the travis_retry.sh
file, otherwise you just get a "command not found" error. See example.sh
for a full example.
Note that the original function as found in the travis-ci/travis-build repository was slightly modified to allow it to be used in a shell context where set -e
is enabled.
For reference, a tweet by Travis CI saying that you should copy the travis_retry
code as I've done here:
https://twitter.com/plexus/status/499194992632811520
This seems very valuable if your build runs inside a docker container, and one needs to push the
travis_retry.bash
(also changed the location in the meanwhile and the originaltemplate
file name) inside the docker image (Dockerfile
).