Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable vagrant-cachier caching by default, but allow to opt-in #85

Merged
merged 2 commits into from
May 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ $ vagrant destroy -f

Make sure vagrant-cachier is disabled when you bring up the VM for packaging:
```
$ GLOBAL_VAGRANT_CACHIER_DISABLED=1 vagrant up
$ unset GLOBAL_VAGRANT_CACHIER_ENABLED
$ vagrant up
```

This will provision the VM as usual. Once the provisioning succeeded, we will
Expand Down
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Vagrant::configure("2") do |config|
EOF

# Ensure we cache as much as possible
if !ENV["GLOBAL_VAGRANT_CACHIER_DISABLED"] && Vagrant.has_plugin?("vagrant-cachier")
if ENV["GLOBAL_VAGRANT_CACHIER_ENABLED"] && Vagrant.has_plugin?("vagrant-cachier")
config.cache.enable :generic, {
"chef_file_cache" => {cache_dir: "/root/.chef/local-mode-cache/cache"},
"berkshelf_cache" => {cache_dir: "/home/vagrant/.berkshelf"},
Expand Down
2 changes: 1 addition & 1 deletion cookbooks/vm/templates/default/Vagrantfile.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Vagrant.configure("2") do |config|
end

# enable cachier globally
if !ENV["GLOBAL_VAGRANT_CACHIER_DISABLED"] && Vagrant.has_plugin?("vagrant-cachier")
if ENV["GLOBAL_VAGRANT_CACHIER_ENABLED"] && Vagrant.has_plugin?("vagrant-cachier")
config.cache.scope = :box

# cache bussers, but only if we detect a test-kitchen run
Expand Down