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: