pax_global_header 0000666 0000000 0000000 00000000064 12545554713 0014525 g ustar 00root root 0000000 0000000 52 comment=40dddfb368526948e769492a00a7937c5a044a4d
vagrant-cachier-1.2.1/ 0000775 0000000 0000000 00000000000 12545554713 0014564 5 ustar 00root root 0000000 0000000 vagrant-cachier-1.2.1/.gitignore 0000664 0000000 0000000 00000000226 12545554713 0016554 0 ustar 00root root 0000000 0000000 *.gem
*.rbc
.bundle
.config
.yardoc
InstalledFiles
_yardoc
coverage
doc/
lib/bundler/man
pkg
rdoc
spec/reports
test/tmp
test/version_tmp
tmp
.vagrant
vagrant-cachier-1.2.1/CHANGELOG.md 0000664 0000000 0000000 00000017314 12545554713 0016403 0 ustar 00root root 0000000 0000000 ## [1.2.1](https://github.com/fgrehm/vagrant-cachier/compare/v1.2.0...v1.2.1) (July 3, 2015)
IMPROVEMENTS:
- Add chef\_zero support to chef bucket [[GH-153]]
[GH-153]: https://github.com/fgrehm/vagrant-cachier/issues/153
## [1.2.0](https://github.com/fgrehm/vagrant-cachier/compare/v1.1.0...v1.2.0) (Jan 14, 2015)
FEATURES:
- [Chef Gems bucket](http://fgrehm.viewdocs.io/vagrant-cachier/buckets/chef_rubygems) [[GH-129]]
[GH-129]: https://github.com/fgrehm/vagrant-cachier/pull/129
BUG FIXES:
- Fix provisioner resolution on Vagrant 1.7+ [[GH-133]] / [[GH-134]]
- Do not modify Vagrant core object, preventing unpredictable behavior [[GH-135]]
[GH-133]: https://github.com/fgrehm/vagrant-cachier/issues/133
[GH-134]: https://github.com/fgrehm/vagrant-cachier/pull/134
[GH-135]: https://github.com/fgrehm/vagrant-cachier/pull/135
## [1.1.0](https://github.com/fgrehm/vagrant-cachier/compare/v1.0.0...v1.1.0) (Oct 15, 2014)
FEATURES:
- [Bower bucket](http://fgrehm.viewdocs.io/vagrant-cachier/buckets/bower) [[GH-125]]
[GH-125]: https://github.com/fgrehm/vagrant-cachier/pull/125
IMPROVEMENTS:
- Resolve $HOME even if VM spits bogus new lines [[GH-122]] / [[GH-124]]
[GH-122]: https://github.com/fgrehm/vagrant-cachier/issues/122
[GH-124]: https://github.com/fgrehm/vagrant-cachier/pull/124
## [1.0.0](https://github.com/fgrehm/vagrant-cachier/compare/v0.9.0...v1.0.0) (Sep 22, 2014)
Public API is considered stable.
## [0.9.0](https://github.com/fgrehm/vagrant-cachier/compare/v0.8.0...v0.9.0) (Aug 9, 2014)
FEATURES:
- Suport for caching packages for Docker containers that doesn't have a base box specified [[GH-116]]
[GH-116]: https://github.com/fgrehm/vagrant-cachier/pull/116
## [0.8.0](https://github.com/fgrehm/vagrant-cachier/compare/v0.7.2...v0.8.0) (Jul 20, 2014)
BACKWARDS INCOMPATIBILITIES:
- Removed deprecated `config.enable_nfs` config.
- Changed composer cache bucket to use `$HOME/.composer/cache` [[GH-89]]
IMPROVEMENTS:
- Set composer cache bucket ownership to the configured SSH user.
BUG FIXES:
- Automatically disable apt-lists bucket when a Windows host is detected [[GH-106]]
- Skip `chmod 777` for `smb` mounted folders [[GH-107]]
- Do not error if base box has been removed and `:box` is configured as the cache scope [[GH-86]]
[GH-86]: https://github.com/fgrehm/vagrant-cachier/issues/86
[GH-89]: https://github.com/fgrehm/vagrant-cachier/issues/89
[GH-106]: https://github.com/fgrehm/vagrant-cachier/issues/106
[GH-107]: https://github.com/fgrehm/vagrant-cachier/issues/107
## [0.7.2](https://github.com/fgrehm/vagrant-cachier/compare/v0.7.1...v0.7.2) (May 08, 2014)
IMPROVEMENTS:
- Add `azure`, `brightbox`, `cloudstack`, `vcloud` and `vsphere` to the list
of known cloud providers [[GH-104]]
[GH-104]: https://github.com/fgrehm/vagrant-cachier/pull/104
## [0.7.1](https://github.com/fgrehm/vagrant-cachier/compare/v0.7.0...v0.7.1) (May 04, 2014)
BUG FIXES:
- Fix support for using multiple generic buckets [[GH-101]]
[GH-101]: https://github.com/fgrehm/vagrant-cachier/pull/101
## [0.7.0](https://github.com/fgrehm/vagrant-cachier/compare/v0.6.0...v0.7.0) (Apr 06, 2014)
FEATURES:
- ["Generic" cache bucket](http://fgrehm.viewdocs.io/vagrant-cachier/buckets/generic) [[GH-94]] / [[GH-4]].
BUG FIXES:
- Fix apt-cacher bucket undefined method error [[GH-96]]
[GH-94]: https://github.com/fgrehm/vagrant-cachier/pull/94
[GH-4]: https://github.com/fgrehm/vagrant-cachier/issues/4
[GH-96]: https://github.com/fgrehm/vagrant-cachier/issues/96
## [0.6.0](https://github.com/fgrehm/vagrant-cachier/compare/v0.5.1...v0.6.0) (Feb 26, 2014)
BACKWARDS INCOMPATIBILITIES:
- Plugin activation is now triggered by the `cache.scope` config and that config
is now required. Previous versions of the plugin had it set to `:box` but
there is no consensus whether `:box` and `:machine` is better. This is to
highlight that you need to think about the caching strategy you are going
to use. For more information and to discuss this move please check [GH-17](https://github.com/fgrehm/vagrant-cachier/issues/17).
- Because `cache.scope` is now a requirement and in order to reduce the amount of
configuration required by the plugin, we enabled automatic bucket detection by
default. To revert to the old behavior you can disable it globally from your
`~/.vagrant.d/Vagrantfile`.
- Support for Vagrant < 1.4 is gone, please use a previous plugin version if
you are running Vagrant 1.2 / 1.3
- Automatic handling of multiple machine scoped cache dirs from versions
prior to 0.3.0 of this plugin was removed.
- Support for `enable_nfs` has been deprecated and will be removed on 0.7.0,
please use `cache.synced_folder_opts = {type: :nfs}` instead.
FEATURES:
- Warm up cache buckets with files available on guest in case bucket is empty
- Support for offline provisioning of apt-packages by caching `/var/lib/apt/lists` [GH-84]
- Support for specifying custom cache bucket synced folder opts
- Support to force disabe the plugin [GH-72]
- Automatically disable the plugin for cloud providers [GH-45]
- Skip configuration of buckets that have been configured already [GH-85]
BUG FIXES:
- Properly fix NFS support for Vagrant 1.4+ [GH-76]
## [0.5.1](https://github.com/fgrehm/vagrant-cachier/compare/v0.5.0...v0.5.1) (Dec 20, 2013)
BUG FIXES:
- Fix NFS support for Vagrant 1.4+ [GH-67]
## [0.5.0](https://github.com/fgrehm/vagrant-cachier/compare/v0.4.1...v0.5.0) (Nov 8, 2013)
FEATURES:
- Support for [zypper] [GH-54]
## [0.4.1](https://github.com/fgrehm/vagrant-cachier/compare/v0.4.0...v0.4.1) (Oct 27, 2013)
BUG FIXES:
- Do not attempt to configure apt-cacher-ng bucket if it is not installed on guest
machine.
## [0.4.0](https://github.com/fgrehm/vagrant-cachier/compare/v0.3.3...v0.4.0) (Oct 23, 2013)
FEATURES:
- Support for [npm](https://npmjs.org/) [GH-51]
- Support for [Composer](http://getcomposer.org/) [GH-48]
- Support for `apt-cacher-ng` [GH-30]
BUG FIXES:
- Allow halting nonresponsive machine when plugin is installed [GH-8]
## [0.3.3](https://github.com/fgrehm/vagrant-cachier/compare/v0.3.2...v0.3.3) (Sep 11, 2013)
BUG FIXES:
- Automatically create `partial` dir under apt cache bucket dir to allow usage
on Ubuntu 10.04 guests [GH-40]
## [0.3.2](https://github.com/fgrehm/vagrant-cachier/compare/v0.3.1...v0.3.2) (Aug 14, 2013)
BUG FIXES:
- Prevent errors when caching is disabled and a provisioner is enabled [GH-41]
## [0.3.1](https://github.com/fgrehm/vagrant-cachier/compare/v0.3.0...v0.3.1) (Aug 13, 2013)
BUG FIXES:
- Prevent errors when caching is disabled
## [0.3.0](https://github.com/fgrehm/vagrant-cachier/compare/v0.2.0...v0.3.0) (Aug 5, 2013)
BACKWARDS INCOMPATIBILITIES:
- Machine scoped cache dirs are now kept on `.vagrant/machines/MACHINE/cache`
to allow downloaded packages to be reused between providers. If a single cache
directory exists, the plugin will automatically move it to the right place,
if multiple directories are found, it will halt execution and will error out,
letting the user know what has to be done in order to fix things.
FEATURES:
- Add `file_cache_path` support for Chef. [GH-14]
- Reconfigure buckets before each provisioner. [GH-26] / [GH-32]
IMPROVEMENTS:
- Don't error out if a bucket is configured for a non-capable guest. [GH-27]
## [0.2.0](https://github.com/fgrehm/vagrant-cachier/compare/v0.1.0...v0.2.0) (July 10, 2013)
FEATURES:
- Support enabling NFS for root cache folder. [GH-7]
- Support RVM bucket
## [0.1.0](https://github.com/fgrehm/vagrant-cachier/compare/v0.0.6...v0.1.0) (June 9, 2013)
IMPROVEMENTS:
- Moves from `Vagrant` to recommended `VagrantPlugins` top-level
module namespace. [GH-9]
## 0.0.6 (May 22, 2013)
- Initial public release.
vagrant-cachier-1.2.1/Gemfile 0000664 0000000 0000000 00000000456 12545554713 0016064 0 ustar 00root root 0000000 0000000 source 'https://rubygems.org'
group :development do
gem 'vagrant', github: 'mitchellh/vagrant', tag: 'v1.7.2'
gem 'rake'
end
group :plugins do
gemspec
gem 'vagrant-lxc', github: 'fgrehm/vagrant-lxc'
gem 'vagrant-pristine', github: 'fgrehm/vagrant-pristine'
gem 'vagrant-omnibus'
end
vagrant-cachier-1.2.1/Gemfile.lock 0000664 0000000 0000000 00000005333 12545554713 0017012 0 ustar 00root root 0000000 0000000 GIT
remote: git://github.com/fgrehm/vagrant-lxc.git
revision: c9cd671a32f730fff4b6e4fdd3687a531af0663c
specs:
vagrant-lxc (1.1.0)
GIT
remote: git://github.com/fgrehm/vagrant-pristine.git
revision: 503dbc47848c81d0fbfa6840491856f518d244a1
specs:
vagrant-pristine (0.3.0)
GIT
remote: git://github.com/mitchellh/vagrant.git
revision: 1cd667b243f4a263cd5322b6455165cc676b6f7f
tag: v1.7.2
specs:
vagrant (1.7.2)
bundler (>= 1.5.2, < 1.8.0)
childprocess (~> 0.5.0)
erubis (~> 2.7.0)
hashicorp-checkpoint (~> 0.1.1)
i18n (~> 0.6.0)
listen (~> 2.8.0)
log4r (~> 1.1.9, < 1.1.11)
net-scp (~> 1.1.0)
net-sftp (~> 2.1)
net-ssh (>= 2.6.6, < 2.10.0)
nokogiri (= 1.6.3.1)
rb-kqueue (~> 0.2.0)
rest-client (>= 1.6.0, < 2.0)
wdm (~> 0.1.0)
winrm (~> 1.1.3)
PATH
remote: .
specs:
GEM
remote: https://rubygems.org/
specs:
akami (1.2.2)
gyoku (>= 0.4.0)
nokogiri
builder (3.2.2)
celluloid (0.16.0)
timers (~> 4.0.0)
childprocess (0.5.5)
ffi (~> 1.0, >= 1.0.11)
erubis (2.7.0)
ffi (1.9.6)
gssapi (1.0.3)
ffi (>= 1.0.1)
gyoku (1.2.2)
builder (>= 2.1.2)
hashicorp-checkpoint (0.1.4)
hitimes (1.2.2)
httpclient (2.6.0.1)
httpi (0.9.7)
rack
i18n (0.6.11)
listen (2.8.5)
celluloid (>= 0.15.2)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
little-plugger (1.1.3)
log4r (1.1.10)
logging (1.8.2)
little-plugger (>= 1.1.3)
multi_json (>= 1.8.4)
mime-types (2.4.3)
mini_portile (0.6.0)
multi_json (1.10.1)
net-scp (1.1.2)
net-ssh (>= 2.6.5)
net-sftp (2.1.2)
net-ssh (>= 2.6.5)
net-ssh (2.9.2)
netrc (0.10.2)
nokogiri (1.6.3.1)
mini_portile (= 0.6.0)
nori (1.1.5)
rack (1.6.0)
rake (10.4.2)
rb-fsevent (0.9.4)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
rb-kqueue (0.2.3)
ffi (>= 0.5.0)
rest-client (1.7.2)
mime-types (>= 1.16, < 3.0)
netrc (~> 0.7)
rubyntlm (0.1.1)
savon (0.9.5)
akami (~> 1.0)
builder (>= 2.1.2)
gyoku (>= 0.4.0)
httpi (~> 0.9)
nokogiri (>= 1.4.0)
nori (~> 1.0)
wasabi (~> 1.0)
timers (4.0.1)
hitimes
uuidtools (2.1.5)
vagrant-omnibus (1.4.1)
wasabi (1.0.0)
nokogiri (>= 1.4.0)
wdm (0.1.0)
winrm (1.1.3)
gssapi (~> 1.0.0)
httpclient (~> 2.2, >= 2.2.0.2)
logging (~> 1.6, >= 1.6.1)
nokogiri (~> 1.5)
rubyntlm (~> 0.1.1)
savon (= 0.9.5)
uuidtools (~> 2.1.2)
PLATFORMS
ruby
DEPENDENCIES
rake
vagrant!
vagrant-cachier!
vagrant-lxc!
vagrant-omnibus
vagrant-pristine!
BUNDLED WITH
1.10.4
vagrant-cachier-1.2.1/LICENSE.txt 0000664 0000000 0000000 00000002060 12545554713 0016405 0 ustar 00root root 0000000 0000000 Copyright (c) 2013-2014 Fabio Rehm
MIT License
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
vagrant-cachier-1.2.1/README.md 0000664 0000000 0000000 00000005710 12545554713 0016046 0 ustar 00root root 0000000 0000000 # vagrant-cachier
[](http://badge.fury.io/rb/vagrant-cachier) [](https://gitter.im/fgrehm/vagrant-cachier)
A [Vagrant](http://www.vagrantup.com/) plugin that helps you reduce the amount of
coffee you drink while waiting for boxes to be provisioned by sharing a common
package cache among similar VM instances. Kinda like [vagrant-apt_cache](https://github.com/avit/vagrant-apt_cache)
or [this magical snippet](http://gist.github.com/juanje/3797297) but targeting
multiple package managers and Linux distros.
## Help Needed!
This project is looking for maintainers, please see [GH-143](https://github.com/fgrehm/vagrant-cachier/issues/143) for more.
## Installation
Make sure you have Vagrant 1.4+ and run:
```
vagrant plugin install vagrant-cachier
```
## Quick start
```ruby
Vagrant.configure("2") do |config|
config.vm.box = 'your-box'
if Vagrant.has_plugin?("vagrant-cachier")
# Configure cached packages to be shared between instances of the same base box.
# More info on http://fgrehm.viewdocs.io/vagrant-cachier/usage
config.cache.scope = :box
# OPTIONAL: If you are using VirtualBox, you might want to use that to enable
# NFS for shared folders. This is also very useful for vagrant-libvirt if you
# want bi-directional sync
config.cache.synced_folder_opts = {
type: :nfs,
# The nolock option can be useful for an NFSv3 client that wants to avoid the
# NLM sideband protocol. Without this option, apt-get might hang if it tries
# to lock files needed for /var/cache/* operations. All of this can be avoided
# by using NFSv4 everywhere. Please note that the tcp option is not the default.
mount_options: ['rw', 'vers=3', 'tcp', 'nolock']
}
# For more information please check http://docs.vagrantup.com/v2/synced-folders/basic_usage.html
end
end
```
For more information please read the documentation available at
http://fgrehm.viewdocs.io/vagrant-cachier.
## Providers that are known to work
* Vagrant's built in VirtualBox and Docker providers
* [vagrant-lxc](https://github.com/fgrehm/vagrant-lxc)
* [VMware providers](http://www.vagrantup.com/vmware) with NFS enabled (See
[GH-24](https://github.com/fgrehm/vagrant-cachier/issues/24) for more info)
* [vagrant-libvirt](https://github.com/pradels/vagrant-libvirt)
* [vagrant-kvm](https://github.com/adrahon/vagrant-kvm)
* _[Let us know if it is compatible with other providers!](https://github.com/fgrehm/vagrant-cachier/issues/new)_
_Please note that as of v0.6.0 the plugin will automatically disable any
previously defined configs for [cloud providers](lib/vagrant-cachier/plugin.rb#L19-22)_
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
vagrant-cachier-1.2.1/Rakefile 0000664 0000000 0000000 00000000145 12545554713 0016231 0 ustar 00root root 0000000 0000000 Dir['./tasks/**/*.rake'].each { |f| load f }
require 'bundler/gem_tasks'
task :ci => ['spec:unit']
vagrant-cachier-1.2.1/development/ 0000775 0000000 0000000 00000000000 12545554713 0017106 5 ustar 00root root 0000000 0000000 vagrant-cachier-1.2.1/development/Cheffile 0000664 0000000 0000000 00000000144 12545554713 0020535 0 ustar 00root root 0000000 0000000 #!/usr/bin/env ruby
#^syntax detection
site 'http://community.opscode.com/api/v1'
cookbook 'java'
vagrant-cachier-1.2.1/development/Cheffile.lock 0000664 0000000 0000000 00000000153 12545554713 0021464 0 ustar 00root root 0000000 0000000 SITE
remote: http://community.opscode.com/api/v1
specs:
java (1.19.2)
DEPENDENCIES
java (>= 0)
vagrant-cachier-1.2.1/development/Vagrantfile 0000664 0000000 0000000 00000010052 12545554713 0021271 0 ustar 00root root 0000000 0000000 # -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.synced_folder "../", "/vagrant", id: 'vagrant-root'
config.cache.scope = :machine
config.cache.auto_detect = true
config.cache.synced_folder_opts = { type: :nfs }
config.vm.provider :virtualbox do |vb|
vb.customize [ "modifyvm", :id, "--memory", 256, "--cpus", "1" ]
end
config.vm.provider :lxc do |lxc|
lxc.customize 'aa_profile', 'unconfined'
end
configure_private_network = lambda do |node, suffix|
node.vm.network :private_network, ip: "192.168.50.#{suffix}"
end
initial_debian_setup = lambda do |debian, git_pkg = 'git'|
debian.vm.provision :shell, inline: "apt-get update && apt-get install -y #{git_pkg} php5-cli curl wget htop"
end
install_nvm_and_rvm = lambda do |node|
# Installs RVM
node.vm.provision :shell, inline: '
if ! [ -d /home/vagrant/.rvm ]; then
HOME=/home/vagrant su -p vagrant -l -c "curl -L https://get.rvm.io | bash -s stable"
fi
'
# Here we have the RVM cache bucket configured, so we install 2.0.0
node.vm.provision :shell, inline: '
if ! [ -d /home/vagrant/.rvm/rubies/ruby-2.0.0* ]; then
HOME=/home/vagrant su -p vagrant -l -c "rvm install 2.0.0 && rvm use 2.0.0 --default"
fi
'
node.vm.provision :shell, inline: '
if ! [ -d /home/vagrant/.nvm ]; then
apt-get install git -y
HOME=/home/vagrant su -p vagrant -l -c "
curl https://raw.github.com/creationix/nvm/master/install.sh | sh
"
fi
'
node.vm.provision :shell, inline: '
if ! [ -d /home/vagrant/.nvm/v0.10* ]; then
HOME=/home/vagrant su -p vagrant -l -c "
nvm install 0.10
nvm alias default 0.10
"
fi
'
end
config.vm.define :ubuntu do |ubuntu|
ubuntu.vm.box = "raring64"
ubuntu.vm.provider :lxc do |_, override|
override.vm.box = 'fgrehm/raring64-lxc'
end
configure_private_network.call ubuntu, 10
initial_debian_setup.call(ubuntu)
install_nvm_and_rvm.call(ubuntu)
ubuntu.omnibus.chef_version = :latest
ubuntu.vm.provision :chef_solo do |chef|
chef.add_recipe "cachier::default"
end
end
config.vm.define :lucid do |lucid|
lucid.vm.box = "lucid64"
# Disable NFS
lucid.cache.synced_folder_opts = { }
configure_private_network.call lucid, 11
initial_debian_setup.call(lucid, 'git-core')
install_nvm_and_rvm.call(lucid)
end
config.vm.define :debian do |debian|
debian.vm.box = "squeeze64"
debian.vm.box_url = 'http://f.willianfernandes.com.br/vagrant-boxes/DebianSqueeze64.box'
configure_private_network.call debian, 12
initial_debian_setup.call(debian)
install_nvm_and_rvm.call(debian)
end
config.vm.define :centos do |centos|
centos.vm.box = 'centos6_64'
centos.vm.box_url = 'http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.4-x86_64-v20130309.box'
configure_private_network.call centos, 13
centos.vm.provision :shell, inline: '
(
mkdir -p /tmp/epel
cd /tmp/epel
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
)
yum install -y libffi-devel ruby-devel git
'
centos.vm.provision :shell, inline: 'gem install bundler'
end
config.vm.define :arch do |arch|
arch.vm.box = 'arch64'
arch.vm.box_url = 'https://dl.dropboxusercontent.com/u/6750592/Arch_Linux_2013.11_x64.box'
# Disable NFS
arch.cache.synced_folder_opts = { }
arch.vm.provision :shell, inline: 'pacman -Syu --noconfirm libffi git ruby && gem install bundler'
end
config.vm.define :opensuse do |suse|
suse.vm.box = 'opensuse-12'
suse.vm.box_url = 'http://sourceforge.net/projects/opensusevagrant/files/12.3/opensuse-12.3-64.box/download'
# Disable NFS
suse.cache.synced_folder_opts = { }
suse.vm.provision :shell, inline: 'time zypper install -y git'
end
end
vagrant-cachier-1.2.1/development/cookbooks/ 0000775 0000000 0000000 00000000000 12545554713 0021077 5 ustar 00root root 0000000 0000000 vagrant-cachier-1.2.1/development/cookbooks/cachier/ 0000775 0000000 0000000 00000000000 12545554713 0022475 5 ustar 00root root 0000000 0000000 vagrant-cachier-1.2.1/development/cookbooks/cachier/recipes/ 0000775 0000000 0000000 00000000000 12545554713 0024127 5 ustar 00root root 0000000 0000000 vagrant-cachier-1.2.1/development/cookbooks/cachier/recipes/default.rb 0000664 0000000 0000000 00000000312 12545554713 0026074 0 ustar 00root root 0000000 0000000 zip_filepath = "#{Chef::Config['file_cache_path']}/vagrant-cachier.tar.gz"
zip_url = "https://github.com/fgrehm/vagrant-cachier/archive/v0.6.0.tar.gz"
remote_file(zip_filepath) { source zip_url }
vagrant-cachier-1.2.1/docs/ 0000775 0000000 0000000 00000000000 12545554713 0015514 5 ustar 00root root 0000000 0000000 vagrant-cachier-1.2.1/docs/benchmarks.md 0000664 0000000 0000000 00000005360 12545554713 0020157 0 ustar 00root root 0000000 0000000 # Benchmarks
During the early days of this plugin, [@fgrehm](https://github.com/fgrehm) wrote
a [blog post](http://fabiorehm.com/blog/2013/05/24/stop-wasting-bandwidth-with-vagrant-cachier#show_me_the_numbers)
with some benchmarks on the time that was cut down by using the plugin. If you
are interested on the numbers only, the VMs tested were one of vagrant-lxc's
Ubuntu [dev boxes](https://github.com/fgrehm/vagrant-lxc/wiki/Development#using-virtualbox-for-development),
[rails-dev-box](https://github.com/rails/rails-dev-box), his own [rails-base-box](https://github.com/fgrehm/rails-base-box)
and Discourse's [dev box](https://github.com/discourse/discourse/blob/master/Vagrantfile)
| | First provision | Second provision | Diff. | APT cache |
| --- | :---: | :---: | :---: | :---: |
| rails-dev-box | 4m45s | 3m20s | ~29% | 66mb |
| rails-base-box | 11m56s | 7m54s | ~34% | 77mb |
| vagrant-lxc | 10m16s | 5m9s | ~50% | 124mb |
| discourse | 1m41s | 49s | ~51% | 62mb |
_Please note that the tests were made on May 24th 2013 and nowadays they might
be a bit different_
Some people have shared their numbers on Twitter and had experienced even better
results:
Holy cow... If you dig Vagrant, and like time - you need Vagrant Cachier. 60% speed increase for me. https://t.co/225jRH7bDa @vagrantup
— Chris Rickard (@chrisrickard) November 12, 2013
vagrant-cachier saved 3:20 off my #vagrant #provisioning http://t.co/VzRRu1QEwL
— Joe Ferguson (@svpernova09) November 11, 2013
Tested vagrant-cachier. Saved 60% of vagrant up time installing 10 rpms with chef. Pretty awesome. Check it out! github.com/fgrehm/vagrant…
— Miguel. (@miguelcnf) June 9, 2013
vagrant-cachier-1.2.1/docs/buckets/ 0000775 0000000 0000000 00000000000 12545554713 0017154 5 ustar 00root root 0000000 0000000 vagrant-cachier-1.2.1/docs/buckets/apt-cacher.md 0000664 0000000 0000000 00000002041 12545554713 0021502 0 ustar 00root root 0000000 0000000 # APT-CACHER Used by Debian-like Linux distros, will get configured under guest's `/var/cache/apt-cacher-ng` and only works with NFS-shared folders since `vboxsf` is enforcing `vagrant`-user and `apt-cacher` is running under `apt-cacher-ng` user. To manually enable it: ```ruby Vagrant.configure("2") do |config| config.vm.box = 'some-debian-box' config.cache.enable :apt_cacher end ``` One use case for this bucket is if you are using containers inside your VMs, e.g VirtualBox -> LXC. This would allow you to reuse packages without sharing folder inside VirtualBox: # install apt-cacher on (Host)-VM $ sudo apt-get install apt-cacher-ng # get the IP for eth0 interface $ ifconfig eth0 |grep "inet addr"|awk '{print $2}' |cut -c6-20 # configure mirror on for your docker/LXC instances: $ echo 'Acquire::http { Proxy "http://X.X.X.X:3142"; };' > /etc/apt/apt.conf.d/10mirror # check, if working by tailing log on (Host)-VM, while installing packages on (Guest)-VMs $ tail -f /var/log/apt-cacher-ng/apt-cacher.log vagrant-cachier-1.2.1/docs/buckets/apt-lists.md 0000664 0000000 0000000 00000001772 12545554713 0021425 0 ustar 00root root 0000000 0000000 # APT lists Used by Debian-like Linux distros, will get configured under guest's `/var/lib/apt/lists`. As explained on [Wikipedia](http://en.wikipedia.org/wiki/Advanced_Packaging_Tool#Files), `/var/lib/apt/lists` is the "storage area for state information for each package resource specified in sources.list". By enabling this bucket, `apt` will be able to install cached packages without hitting the remote repositories for the main package lists, [being particularly useful when developing offline](https://github.com/fgrehm/vagrant-cachier/pull/84#issue-27311414). To manually enable it: ```ruby Vagrant.configure("2") do |config| config.vm.box = 'some-debian-box' config.cache.enable :apt_lists end ``` ## Heads up! This bucket is automatically disabled for Windows hosts, please have a look at the following issues for more information: * https://github.com/fgrehm/vagrant-cachier/issues/106 * https://github.com/fgrehm/vagrant-cachier/issues/109 * https://github.com/fgrehm/vagrant-cachier/issues/113 vagrant-cachier-1.2.1/docs/buckets/apt.md 0000664 0000000 0000000 00000000760 12545554713 0020265 0 ustar 00root root 0000000 0000000 # APT Used by Debian-like Linux distros, will get configured under guest's `/var/cache/apt/archives`. To manually enable it: ```ruby Vagrant.configure("2") do |config| config.vm.box = 'some-debian-box' config.cache.enable :apt end ``` _Please note that to avoid re-downloading packages, you should avoid `apt-get clean` as much as possible in order to make a better use of the cache, even if you are packaging a box since the downloaded packages are actually stored on the host machine._ vagrant-cachier-1.2.1/docs/buckets/bower.md 0000664 0000000 0000000 00000000457 12545554713 0020622 0 ustar 00root root 0000000 0000000 # [Bower](http://bower.io/) Compatible with probably any type of linux guest distro, will cache guests' `$HOME/.cache/bower` if bower is detected. To manually enable it: ```ruby Vagrant.configure("2") do |config| config.vm.box = 'some-box-with-bower-installed' config.cache.enable :bower end ``` vagrant-cachier-1.2.1/docs/buckets/chef.md 0000664 0000000 0000000 00000000461 12545554713 0020404 0 ustar 00root root 0000000 0000000 # Chef When a Chef provisioner is detected, this bucket caches the default `file_cache_path` directory, `/var/chef/cache`. Requires Vagrant 1.2.4+. To manually enable it: ```ruby Vagrant.configure("2") do |config| config.vm.box = 'some-box-using-chef-provisioner' config.cache.enable :chef end ``` vagrant-cachier-1.2.1/docs/buckets/chef_rubygems.md 0000664 0000000 0000000 00000001036 12545554713 0022320 0 ustar 00root root 0000000 0000000 # Chef RubyGems When a Chef installation is detected, this bucket caches its embedded gems. Most of these gems are part of the Chef omnibus package but sometimes cookbooks need to install extra gems to run within the context of a Chef recipe using the `chef_gem` resource. The embedded Chef gem location is returned by running the `/opt/chef/embedded/bin/gem env gemdir` command. To manually enable it: ```ruby Vagrant.configure("2") do |config| config.vm.box = 'some-box-using-chef-provisioner' config.cache.enable :chef_gem end ``` vagrant-cachier-1.2.1/docs/buckets/composer.md 0000664 0000000 0000000 00000000473 12545554713 0021331 0 ustar 00root root 0000000 0000000 # [Composer](http://getcomposer.org/) Compatible with probably any type of linux guest distro, will cache guests' `$HOME/.composer/cache` if PHP is detected. To manually enable it: ```ruby Vagrant.configure("2") do |config| config.vm.box = 'some-box-with-php-installed' config.cache.enable :composer end ``` vagrant-cachier-1.2.1/docs/buckets/generic.md 0000664 0000000 0000000 00000002157 12545554713 0021117 0 ustar 00root root 0000000 0000000 # Generic This bucket is never enabled by default. You have to enable it explicitly like this: ```ruby Vagrant.configure("2") do |config| config.cache.enable :generic, { :cache_dir => "/var/cache/some" } end ``` The `:cache_dir` parameter is required. It specifies the directory on the guest that will be cached under the "/tmp/vagrant-cache/generic" bucket. You may enable more than one generic bucket by giving them different names, like this: ```ruby Vagrant.configure("2") do |config| config.cache.enable :generic, { "one" => { cache_dir: "/var/cache/one" }, "two" => { cache_dir: "/var/cache/two" }, } end ``` In this case you get two buckets called "one" and "two" under the guest's `/tmp/vagrant-cache` directory. The Generic bucket is useful if you want to implement a caching mechanism by hand. For instance, if you want to cache your wget downloads under `/var/cache/wget` you can do this: ```ruby Vagrant.configure("2") do |config| config.cache.enable :generic, { "wget" => { cache_dir: "/var/cache/wget" }, } end ``` Then, you invoke wget like this: ```sh wget -N -P /var/cache/wget URL ``` vagrant-cachier-1.2.1/docs/buckets/npm.md 0000664 0000000 0000000 00000001142 12545554713 0020266 0 ustar 00root root 0000000 0000000 # [npm](https://npmjs.org/) Compatible with probably any type of linux guest distro, will hook into npm's cache directory under the result of running `npm config get cache` as the default SSH user (usually `vagrant`) on your guest. To manually enable it: ```ruby Vagrant.configure("2") do |config| config.vm.box = 'some-box-with-nodejs-installed' config.cache.enable :npm end ``` If you use [nvm](https://github.com/creationix/nvm) / [n](https://github.com/visionmedia/n) on the guest machine, make sure it is already installed before enabling the bucket, otherwise you won't benefit from this plugin. vagrant-cachier-1.2.1/docs/buckets/pacman.md 0000664 0000000 0000000 00000000353 12545554713 0020736 0 ustar 00root root 0000000 0000000 # Pacman Used by Arch Linux, will get configured under guest's `/var/cache/pacman/pkg`. To manually enable it: ```ruby Vagrant.configure("2") do |config| config.vm.box = 'some-arch-linux-box' config.cache.enable :pacman end ``` vagrant-cachier-1.2.1/docs/buckets/rubygems.md 0000664 0000000 0000000 00000001506 12545554713 0021335 0 ustar 00root root 0000000 0000000 # RubyGems Compatible with probably with any type of guest distro, will hook into the `cache` folder under the result of running `gem env gemdir` as the default SSH user (usualy `vagrant`) on your guest. If you use rbenv / rvm on the guest machine, make sure it is already installed before enabling the bucket, otherwise you won't benefit from this plugin. To manually enable it: ```ruby Vagrant.configure("2") do |config| config.vm.box = 'some-box-with-ruby-installed' config.cache.enable :gem end ``` ## Heads up about `bundle install --deployment` Please note that when the `--deployment` flag is passed on to `bundle install` your gems **will not be cached** since bundler ends up skipping the default gem cache dir. For more information about this, please check [GH-62](https://github.com/fgrehm/vagrant-cachier/issues/62). vagrant-cachier-1.2.1/docs/buckets/rvm.md 0000664 0000000 0000000 00000003345 12545554713 0020307 0 ustar 00root root 0000000 0000000 # [rvm](https://rvm.io/) Compatible with probably with any type of linux guest distro, will hook into the `cache` folder under the result of running rvm info as the default SSH user (usualy `vagrant`) on your guest. If you use rvm on the guest machine, make sure it is already installed before enabling the bucket, otherwise you won't benefit from this plugin. To manually enable it: ```ruby Vagrant.configure("2") do |config| config.vm.box = 'some-box-with-rvm-installed' config.cache.enable :gem end ``` ## Heads up! If you are installing rvm, rubies and gems on a single provisioning step, **you will not benefit from this bucket**. There is absolutely no way we can "magically" hook into your provisioning scripts to configure things for leveraging the cache. For instance, the following shell provisioner **will result in no package cached at all**: ```ruby config.vm.provision :shell, privileged: false, inline: %[ curl -L https://get.rvm.io | bash -s stable rvm install 1.9.3 rvm use 1.9.3 --default cd /path/to/project bundle install ] ``` To work around that you can either configure things by hand on your provisioning scripts or you can enable automatic bucket detection and split your scripts into multiple stages: ```ruby # Install RVM so that Ruby tarballs are cached config.vm.provision :shell, privileged: false, inline: %[ curl -L https://get.rvm.io | bash -s stable ] # Install Ruby 1.9.3 making use of the RVM cache and configure the RubyGems # cache afterwards config.vm.provision :shell, privileged: false, inline: %[ rvm install 1.9.3 rvm use 1.9.3 --default ] # Install gems making use of the RubyGems cache config.vm.provision :shell, privileged: false, inline: %[ cd /path/to/project bundle install ] ``` vagrant-cachier-1.2.1/docs/buckets/yum.md 0000664 0000000 0000000 00000001223 12545554713 0020306 0 ustar 00root root 0000000 0000000 # Yum Used by CentOS guests, will get configured under guest's `/var/cache/yum`. It will also [make sure](lib/vagrant-cachier/bucket/yum.rb#L20) that `keepcache` is set to `1` on guest's `/etc/yum.conf`. To manually enable it: ```ruby Vagrant.configure("2") do |config| config.vm.box = 'some-centos-box' config.cache.enable :yum end ``` ### :warning: Notice about Windows hosts :warning: In case this bucket is enabled and a Windows host is in use, you might see an ugly stacktrace as described on [this comment](https://github.com/fgrehm/vagrant-cachier/issues/117#issuecomment-50548393) if some Yum repository is not available during provisioning. vagrant-cachier-1.2.1/docs/buckets/zypper.md 0000664 0000000 0000000 00000000542 12545554713 0021030 0 ustar 00root root 0000000 0000000 # Zypper Used by SuSE guests, will get configured under guest's `/var/cache/zypp/packages`. It will also [make sure](lib/vagrant-cachier/bucket/zypper.rb#L20) that `keep-packages` is enabled for all repositories. To manually enable it: ```ruby Vagrant.configure("2") do |config| config.vm.box = 'some-suse-box' config.cache.enable :zypper end ``` vagrant-cachier-1.2.1/docs/development.md 0000664 0000000 0000000 00000005136 12545554713 0020365 0 ustar 00root root 0000000 0000000 # Development ## Installing from sources If you want to install the plugin from sources: ```bash git clone https://github.com/fgrehm/vagrant-cachier.git cd vagrant-cachier bundle install bundle exec rake build vagrant plugin install pkg/vagrant-cachier-VERSION.gem ``` ## Sanity checks While we don't get to implement some proper unit testing, there are some basic [Bats](https://github.com/sstephenson/bats) tests that basically acts as a [sanity check](https://github.com/fgrehm/vagrant-cachier/blob/master/spec/acceptance/sanity_check.bats) that you can run with `bats spec/acceptance` in case you are planning to submit a Pull Request. Just keep in mind that it might take a while to run if you are using the default VirtualBox provider. ## How to create a new bucket? The concept of a cache _bucket_ is pretty easy to understand, we basically symlink a folder under the guest's `/tmp/vagrant-cache` into the folder where other tools keep downloaded packages. For example, in the case of the [apt bucket](buckets/apt), we symlink `/var/cache/apt/archives` to `/tmp/vagrant-cache/apt` so that `.deb` packages downloaded with `apt-get install` can be reused when bringing machines up from scratch. If you want to see some other package manager supported, you'll first need to know if it has some sort of caching in place, where does it get stored and if it needs some extra configuration. For some managers that path will be fixed (like the canonical apt bucket), for others you might need to read some configuration by [running a command](https://github.com/fgrehm/vagrant-cachier/blob/master/lib/vagrant-cachier/cap/linux/rvm_path.rb#L10) on the guest VM (like [rvm](buckets/rvm)) and you might even need to [tweak some configs](https://github.com/fgrehm/vagrant-cachier/blob/master/lib/vagrant-cachier/bucket/yum.rb#L20) on the guest (like the [yum](buckets/yum) bucket). There's currently a lot of duplication around the "installation" of cache buckets so there's plenty of source code for you to read in order to understand how things work under the hood but if you don't feel comfortable reading / writing Ruby code you can provide a high level overview of how to do things using plain old bash. For example, if you were to explain how to set up the rvm bucket, the script below should give vagrant-cachier maintainers an overview of how to set things up: ```bash # Check is rvm is installed if ! $(rvm info > /dev/null); then exit 0 fi # If it is installed, read the cache dir RVM_CACHE="${rvm_path}/archives" # "Install" the bucket! mkdir -p /tmp/vagrant-cache/rvm/archives ln -s /tmp/vagrant-cache/rvm/archives $RVM_CACHE ``` vagrant-cachier-1.2.1/docs/how-does-it-work.md 0000664 0000000 0000000 00000003674 12545554713 0021167 0 ustar 00root root 0000000 0000000 ## How does it work? On vagrant-cachier's _"jargon"_, cached packages are kept in _cache buckets_. Those _buckets_ are basically directories that are shared between the host machine and VMs that are kept around between `vagrant destroy`s. Each _bucket_ (or synced folder if you prefer) is meant to cache specific types of packages, like [apt](buckets/apt)'s `.deb`s or [RubyGems](buckets/rubygems) `.gem`s. Please have a look at the "Available Buckets" menu above for more information on each bucket. Regarding configurations, right now the plugin does not make any assumptions for you and you have to configure things properly from your `Vagrantfile`. In other words, _the plugin is disabled by default_. Cache buckets will always be available from `/tmp/vagrant-cache` on your guest and the appropriate folders will get symlinked to the right path _after_ the machine is up but _right before_ it gets provisioned. We _could_ potentially do it on one go and share bucket's folders directly to the right path if we were only using VirtualBox because it shares folders _after_ booting the machine but the LXC provider does that _as part of_ the boot process (synced folders are actually `lxc-start` parameters) and as of now we are not able to get some information that this plugin requires about the guest machine / container before it is actually up and running. Under the hood, the plugin will hook into Vagrant in order to set things up for each configured cache bucket _before and after_ running each defined provisioner. Before halting the machine, it will also revert the changes required to set things up by hooking into calls to `Vagrant::Builtin::GracefulHalt` so that you can repackage the machine for others to use without requiring users to install the plugin as well. Please keep in mind that this plugin won't do magic, if you are compiling things during provisioning or manually downloading packages outside of a bucket you won't see that much of improvement. vagrant-cachier-1.2.1/docs/index.md 0000664 0000000 0000000 00000004671 12545554713 0017155 0 ustar 00root root 0000000 0000000 # vagrant-cachier A [Vagrant](http://www.vagrantup.com/) plugin that helps you reduce the amount of coffee you drink while waiting for boxes to be provisioned by sharing a common package cache among similiar VM instances. Kinda like [vagrant-apt_cache](https://github.com/avit/vagrant-apt_cache) or [this magical snippet](http://gist.github.com/juanje/3797297) but targetting multiple package managers and Linux distros. ## Installation Make sure you have Vagrant 1.4+ and run: ``` vagrant plugin install vagrant-cachier ``` ## Quick start The easiest way to set things up is just to enable [cache buckets auto detection](usage) from within your `Vagrantfile`: ```ruby Vagrant.configure("2") do |config| config.vm.box = 'your-box' if Vagrant.has_plugin?("vagrant-cachier") # Configure cached packages to be shared between instances of the same base box. # More info on the "Usage" link above config.cache.scope = :box # OPTIONAL: If you are using VirtualBox, you might want to use that to enable # NFS for shared folders. This is also very useful for vagrant-libvirt if you # want bi-directional sync config.cache.synced_folder_opts = { type: :nfs, # The nolock option can be useful for an NFSv3 client that wants to avoid the # NLM sideband protocol. Without this option, apt-get might hang if it tries # to lock files needed for /var/cache/* operations. All of this can be avoided # by using NFSv4 everywhere. Please note that the tcp option is not the default. mount_options: ['rw', 'vers=3', 'tcp', 'nolock'] } end end ``` For more information please check out the links on the menu above. ## Providers that are known to work * Vagrant's built in VirtualBox provider * [vagrant-lxc](https://github.com/fgrehm/vagrant-lxc) * [VMware providers](http://www.vagrantup.com/vmware) with NFS enabled (See [GH-24](https://github.com/fgrehm/vagrant-cachier/issues/24) for more info) * [vagrant-libvirt](https://github.com/pradels/vagrant-libvirt) * [vagrant-kvm](https://github.com/adrahon/vagrant-kvm) _Please note that as of v0.6.0 the plugin will automatically disable any previously defined configs for [cloud providers](lib/vagrant-cachier/plugin.rb#L19-22)_ ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request vagrant-cachier-1.2.1/docs/template.html 0000664 0000000 0000000 00000013177 12545554713 0020226 0 ustar 00root root 0000000 0000000vagrant-cachier took my vagrant spin up from 30 to 5 minutes and reduced my caffeine intake by 3 cups http://t.co/V0uYpr3U0y
— Russell Cardullo (@russellcardullo) June 7, 2013