This moves caching tasks that we otherwise put in install and before_cache as separate (and in my experience inefficient) steps into the role itself.
To enable it, all we really need is to add the following into .travis.yml:
cache:
directories:
- "$HOME/lxc"
A different directory can be specified as well, but the lxc_cache_directory role variable must be updated as well.
Caching can be configured on a per profile basis with the lxc_cache_profiles role variable. A gzipped tarball is generated for each profile and stored in the lxc_cache_directory once base containers are built. On the next build, they are extracted prior to building the base containers. If any files have been modified, other than the ones we ignore in travis_lxc_profiles[profile].rootfs_exclude, then the tarball is repackaged - Travis will see this as a change and upload the new cache. Otherwise, Travis will not reupload the cache (thus saving on build time).
This moves caching tasks that we otherwise put in
install
andbefore_cache
as separate (and in my experience inefficient) steps into the role itself.To enable it, all we really need is to add the following into
.travis.yml
:A different directory can be specified as well, but the
lxc_cache_directory
role variable must be updated as well.Caching can be configured on a per profile basis with the
lxc_cache_profiles
role variable. A gzipped tarball is generated for each profile and stored in thelxc_cache_directory
once base containers are built. On the next build, they are extracted prior to building the base containers. If any files have been modified, other than the ones we ignore intravis_lxc_profiles[profile].rootfs_exclude
, then the tarball is repackaged - Travis will see this as a change and upload the new cache. Otherwise, Travis will not reupload the cache (thus saving on build time).