Extract the travis-ci shell script, so that it is easier to test