Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Travis CI: Avoiding repeated installation of packages for each commit

As you can see in this travis.yml file, my code is dependent on some third party libraries for which I am installing them on remote system before building the project.

Travis downloads and builds these libraries every time I push a commit, can this be avoided? I mean, to do it only once for a project and then later build process uses those already built libraries for subsequent commits?

like image 597
Pranav Avatar asked Apr 13 '15 11:04

Pranav


1 Answers

There is a feature of caching directories and dependencies but it is currently experimental and not available for public repositories directly. To add this support for public repositories we have to disable sudoing by adding sudo: false to the top level of .travis.yml. This will route the future builds to container-based infrastructure of Travis CI.

But the way caching works right now it has limitations, quoting from the documentation:

The caching tars up all the directories listed in the configuration and uploads them to S3, using a secure and protected URL, ensuring security and privacy of the uploaded archives.
Note that this makes our cache not network-local, it’s still bound to network bandwidth and DNS resolutions for S3. That impacts what you can and should store in the cache. If you store archives larger than a few hundred megabytes in the cache, it’s unlikely that you’ll see a big speed improvement.

like image 95
Pranav Avatar answered Oct 16 '22 03:10

Pranav