chiark / gitweb /
buildserver: vagrant-cachier conflicts with custom apt cache
authorHans-Christoph Steiner <hans@eds.org>
Tue, 30 Aug 2016 19:23:40 +0000 (21:23 +0200)
committerHans-Christoph Steiner <hans@eds.org>
Mon, 12 Sep 2016 12:58:08 +0000 (14:58 +0200)
The technique where /var/cache/apt is mounted as a shared folder conflicts
with vagrant-cachier's workings.  Therefore, ignore vagrant-cachier if the
user selects ./makebuildserver's custom apt cache.  The shared folder way
has the advantage for CI builds of storing the cache outside of
VAGRANT_HOME, which is set to be in the git project.  That gets wiped by
`git clean -fdx` on each CI build.

buildserver/Vagrantfile

index e586e05c5798697824e2a8baa9402684599ffcf0..a7b1745fa2c9cc3835f260ea57fa015e8bcdf3b8 100644 (file)
@@ -4,7 +4,8 @@ configfile = YAML.load_file('Vagrantfile.yaml')
 
 Vagrant.configure("2") do |config|
 
-  if Vagrant.has_plugin?("vagrant-cachier")
+  # these two caching methods conflict, so only use one at a time
+  if Vagrant.has_plugin?("vagrant-cachier") and not configfile.has_key? "aptcachedir"
     config.cache.scope = :box
     config.cache.auto_detect = false
     config.cache.enable :apt