What is the optimal way to store data-files for testing using travis-ci + Docker? What is the optimal way to store data-files for testing using travis-ci + Docker? docker docker

What is the optimal way to store data-files for testing using travis-ci + Docker?


Have you considered using Travis File Cache?

You can write your test.sh script in a way so that it will only download a test file if it was not available on the local file system yet.

In your .travis.yml file, you specify which directories should be cached after a successful build. Travis will automatically restore that directory and files in it at the beginning of the next build. As your test.sh script will then notice the file exists already, it will simply skip the download and your build should be a little faster.

Note that how the Travis cache works is that it will create an archive file and put it on some cloud storage where it will need to download it later on as well. However, the assumption is that the network traffic will likely be inside that "cloud" and potentially in the same data center as well. This should still give you some benefits in terms of build time and lower use of resources in your own infrastructure.