Compare commits
No commits in common. "master" and "v0.8.0" have entirely different histories.
27 changed files with 51 additions and 416 deletions
56
CHANGELOG.md
56
CHANGELOG.md
|
@ -1,59 +1,7 @@
|
||||||
## [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)
|
## [0.8.0](https://github.com/fgrehm/vagrant-cachier/compare/v0.7.2...v0.8.0) (Jul 20, 2014)
|
||||||
|
|
||||||
|
**This is considered a release candidate for a 1.0 that will be cut within ~2 weeks if no major issues are reported**
|
||||||
|
|
||||||
BACKWARDS INCOMPATIBILITIES:
|
BACKWARDS INCOMPATIBILITIES:
|
||||||
|
|
||||||
- Removed deprecated `config.enable_nfs` config.
|
- Removed deprecated `config.enable_nfs` config.
|
||||||
|
|
2
Gemfile
2
Gemfile
|
@ -1,7 +1,7 @@
|
||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
group :development do
|
group :development do
|
||||||
gem 'vagrant', github: 'mitchellh/vagrant', tag: 'v1.7.2'
|
gem 'vagrant', github: 'mitchellh/vagrant', tag: 'v1.6.3'
|
||||||
gem 'rake'
|
gem 'rake'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
58
Gemfile.lock
58
Gemfile.lock
|
@ -1,8 +1,8 @@
|
||||||
GIT
|
GIT
|
||||||
remote: git://github.com/fgrehm/vagrant-lxc.git
|
remote: git://github.com/fgrehm/vagrant-lxc.git
|
||||||
revision: c9cd671a32f730fff4b6e4fdd3687a531af0663c
|
revision: 95b18a5d5cf43e17b8bd99a265d281739a137988
|
||||||
specs:
|
specs:
|
||||||
vagrant-lxc (1.1.0)
|
vagrant-lxc (1.0.0.alpha.3.dev)
|
||||||
|
|
||||||
GIT
|
GIT
|
||||||
remote: git://github.com/fgrehm/vagrant-pristine.git
|
remote: git://github.com/fgrehm/vagrant-pristine.git
|
||||||
|
@ -12,29 +12,26 @@ GIT
|
||||||
|
|
||||||
GIT
|
GIT
|
||||||
remote: git://github.com/mitchellh/vagrant.git
|
remote: git://github.com/mitchellh/vagrant.git
|
||||||
revision: 1cd667b243f4a263cd5322b6455165cc676b6f7f
|
revision: 85d63a91f7aff7c16afee1dbc8bccc11cc6faa5e
|
||||||
tag: v1.7.2
|
tag: v1.6.3
|
||||||
specs:
|
specs:
|
||||||
vagrant (1.7.2)
|
vagrant (1.6.3)
|
||||||
bundler (>= 1.5.2, < 1.8.0)
|
bundler (>= 1.5.2, < 1.7.0)
|
||||||
childprocess (~> 0.5.0)
|
childprocess (~> 0.5.0)
|
||||||
erubis (~> 2.7.0)
|
erubis (~> 2.7.0)
|
||||||
hashicorp-checkpoint (~> 0.1.1)
|
|
||||||
i18n (~> 0.6.0)
|
i18n (~> 0.6.0)
|
||||||
listen (~> 2.8.0)
|
listen (~> 2.7.1)
|
||||||
log4r (~> 1.1.9, < 1.1.11)
|
log4r (~> 1.1.9, < 1.1.11)
|
||||||
net-scp (~> 1.1.0)
|
net-scp (~> 1.1.0)
|
||||||
net-sftp (~> 2.1)
|
|
||||||
net-ssh (>= 2.6.6, < 2.10.0)
|
net-ssh (>= 2.6.6, < 2.10.0)
|
||||||
nokogiri (= 1.6.3.1)
|
|
||||||
rb-kqueue (~> 0.2.0)
|
rb-kqueue (~> 0.2.0)
|
||||||
rest-client (>= 1.6.0, < 2.0)
|
|
||||||
wdm (~> 0.1.0)
|
wdm (~> 0.1.0)
|
||||||
winrm (~> 1.1.3)
|
winrm (~> 1.1.3)
|
||||||
|
|
||||||
PATH
|
PATH
|
||||||
remote: .
|
remote: .
|
||||||
specs:
|
specs:
|
||||||
|
vagrant-cachier (0.8.0)
|
||||||
|
|
||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
|
@ -43,23 +40,21 @@ GEM
|
||||||
gyoku (>= 0.4.0)
|
gyoku (>= 0.4.0)
|
||||||
nokogiri
|
nokogiri
|
||||||
builder (3.2.2)
|
builder (3.2.2)
|
||||||
celluloid (0.16.0)
|
celluloid (0.15.2)
|
||||||
timers (~> 4.0.0)
|
timers (~> 1.1.0)
|
||||||
childprocess (0.5.5)
|
childprocess (0.5.3)
|
||||||
ffi (~> 1.0, >= 1.0.11)
|
ffi (~> 1.0, >= 1.0.11)
|
||||||
erubis (2.7.0)
|
erubis (2.7.0)
|
||||||
ffi (1.9.6)
|
ffi (1.9.3)
|
||||||
gssapi (1.0.3)
|
gssapi (1.0.3)
|
||||||
ffi (>= 1.0.1)
|
ffi (>= 1.0.1)
|
||||||
gyoku (1.2.2)
|
gyoku (1.1.1)
|
||||||
builder (>= 2.1.2)
|
builder (>= 2.1.2)
|
||||||
hashicorp-checkpoint (0.1.4)
|
httpclient (2.4.0)
|
||||||
hitimes (1.2.2)
|
|
||||||
httpclient (2.6.0.1)
|
|
||||||
httpi (0.9.7)
|
httpi (0.9.7)
|
||||||
rack
|
rack
|
||||||
i18n (0.6.11)
|
i18n (0.6.11)
|
||||||
listen (2.8.5)
|
listen (2.7.9)
|
||||||
celluloid (>= 0.15.2)
|
celluloid (>= 0.15.2)
|
||||||
rb-fsevent (>= 0.9.3)
|
rb-fsevent (>= 0.9.3)
|
||||||
rb-inotify (>= 0.9)
|
rb-inotify (>= 0.9)
|
||||||
|
@ -68,28 +63,21 @@ GEM
|
||||||
logging (1.8.2)
|
logging (1.8.2)
|
||||||
little-plugger (>= 1.1.3)
|
little-plugger (>= 1.1.3)
|
||||||
multi_json (>= 1.8.4)
|
multi_json (>= 1.8.4)
|
||||||
mime-types (2.4.3)
|
|
||||||
mini_portile (0.6.0)
|
mini_portile (0.6.0)
|
||||||
multi_json (1.10.1)
|
multi_json (1.10.1)
|
||||||
net-scp (1.1.2)
|
net-scp (1.1.2)
|
||||||
net-ssh (>= 2.6.5)
|
net-ssh (>= 2.6.5)
|
||||||
net-sftp (2.1.2)
|
net-ssh (2.9.1)
|
||||||
net-ssh (>= 2.6.5)
|
nokogiri (1.6.3)
|
||||||
net-ssh (2.9.2)
|
|
||||||
netrc (0.10.2)
|
|
||||||
nokogiri (1.6.3.1)
|
|
||||||
mini_portile (= 0.6.0)
|
mini_portile (= 0.6.0)
|
||||||
nori (1.1.5)
|
nori (1.1.5)
|
||||||
rack (1.6.0)
|
rack (1.5.2)
|
||||||
rake (10.4.2)
|
rake (10.3.2)
|
||||||
rb-fsevent (0.9.4)
|
rb-fsevent (0.9.4)
|
||||||
rb-inotify (0.9.5)
|
rb-inotify (0.9.5)
|
||||||
ffi (>= 0.5.0)
|
ffi (>= 0.5.0)
|
||||||
rb-kqueue (0.2.3)
|
rb-kqueue (0.2.3)
|
||||||
ffi (>= 0.5.0)
|
ffi (>= 0.5.0)
|
||||||
rest-client (1.7.2)
|
|
||||||
mime-types (>= 1.16, < 3.0)
|
|
||||||
netrc (~> 0.7)
|
|
||||||
rubyntlm (0.1.1)
|
rubyntlm (0.1.1)
|
||||||
savon (0.9.5)
|
savon (0.9.5)
|
||||||
akami (~> 1.0)
|
akami (~> 1.0)
|
||||||
|
@ -99,9 +87,8 @@ GEM
|
||||||
nokogiri (>= 1.4.0)
|
nokogiri (>= 1.4.0)
|
||||||
nori (~> 1.0)
|
nori (~> 1.0)
|
||||||
wasabi (~> 1.0)
|
wasabi (~> 1.0)
|
||||||
timers (4.0.1)
|
timers (1.1.0)
|
||||||
hitimes
|
uuidtools (2.1.4)
|
||||||
uuidtools (2.1.5)
|
|
||||||
vagrant-omnibus (1.4.1)
|
vagrant-omnibus (1.4.1)
|
||||||
wasabi (1.0.0)
|
wasabi (1.0.0)
|
||||||
nokogiri (>= 1.4.0)
|
nokogiri (>= 1.4.0)
|
||||||
|
@ -125,6 +112,3 @@ DEPENDENCIES
|
||||||
vagrant-lxc!
|
vagrant-lxc!
|
||||||
vagrant-omnibus
|
vagrant-omnibus
|
||||||
vagrant-pristine!
|
vagrant-pristine!
|
||||||
|
|
||||||
BUNDLED WITH
|
|
||||||
1.10.4
|
|
||||||
|
|
14
README.md
14
README.md
|
@ -1,19 +1,14 @@
|
||||||
🟢 We plan to support and maintain vagrant-lxc, as well as clean it up.<br/>
|
|
||||||
🟢 Please feel free to contribute Issues and pull requests.<br/>
|
|
||||||
🟢 P.S: Thanks [Fabio Rehm](https://fabiorehm.com) for the amazing initial project.
|
|
||||||
|
|
||||||
--------
|
|
||||||
|
|
||||||
# vagrant-cachier
|
# vagrant-cachier
|
||||||
|
|
||||||
[](http://badge.fury.io/rb/vagrant-cachier) [](https://gitter.im/fgrehm/vagrant-cachier)
|
[](http://badge.fury.io/rb/vagrant-cachier) [](https://www.gittip.com/fgrehm/)
|
||||||
|
|
||||||
A [Vagrant](http://www.vagrantup.com/) plugin that helps you reduce the amount of
|
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
|
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)
|
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 targeting
|
or [this magical snippet](http://gist.github.com/juanje/3797297) but targetting
|
||||||
multiple package managers and Linux distros.
|
multiple package managers and Linux distros.
|
||||||
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Make sure you have Vagrant 1.4+ and run:
|
Make sure you have Vagrant 1.4+ and run:
|
||||||
|
@ -58,7 +53,6 @@ http://fgrehm.viewdocs.io/vagrant-cachier.
|
||||||
* [vagrant-lxc](https://github.com/fgrehm/vagrant-lxc)
|
* [vagrant-lxc](https://github.com/fgrehm/vagrant-lxc)
|
||||||
* [VMware providers](http://www.vagrantup.com/vmware) with NFS enabled (See
|
* [VMware providers](http://www.vagrantup.com/vmware) with NFS enabled (See
|
||||||
[GH-24](https://github.com/fgrehm/vagrant-cachier/issues/24) for more info)
|
[GH-24](https://github.com/fgrehm/vagrant-cachier/issues/24) for more info)
|
||||||
* [vagrant-parallels](https://github.com/Parallels/vagrant-parallels)
|
|
||||||
* [vagrant-libvirt](https://github.com/pradels/vagrant-libvirt)
|
* [vagrant-libvirt](https://github.com/pradels/vagrant-libvirt)
|
||||||
* [vagrant-kvm](https://github.com/adrahon/vagrant-kvm)
|
* [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)_
|
* _[Let us know if it is compatible with other providers!](https://github.com/fgrehm/vagrant-cachier/issues/new)_
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
# [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
|
|
||||||
```
|
|
|
@ -1,18 +0,0 @@
|
||||||
# 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
|
|
||||||
```
|
|
|
@ -1,20 +0,0 @@
|
||||||
# DNF
|
|
||||||
|
|
||||||
Used by Fedora guests, will get configured under guest's `/var/cache/dnf`. It will
|
|
||||||
also [make sure](lib/vagrant-cachier/bucket/dnf.rb#L20) that `keepcache` is set to
|
|
||||||
`1` on guest's `/etc/dnf/dnf.conf`.
|
|
||||||
|
|
||||||
To manually enable it:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
Vagrant.configure("2") do |config|
|
|
||||||
config.vm.box = 'some-fedora-box'
|
|
||||||
config.cache.enable :dnf
|
|
||||||
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 DNF repository is not available during provisioning.
|
|
|
@ -1,15 +0,0 @@
|
||||||
# [pip](https://pip.pypa.io/)
|
|
||||||
|
|
||||||
Compatible with probably any type of linux guest distro, will hook into pip's
|
|
||||||
http and wheels cache directory under `$HOME/.cache/pip/http` and `$HOME/.cache/pip/wheels` 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-pip-installed'
|
|
||||||
config.cache.enable :pip
|
|
||||||
end
|
|
||||||
```
|
|
||||||
|
|
|
@ -12,9 +12,3 @@ Vagrant.configure("2") do |config|
|
||||||
config.cache.enable :yum
|
config.cache.enable :yum
|
||||||
end
|
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.
|
|
||||||
|
|
|
@ -87,25 +87,18 @@
|
||||||
<li><a tabindex="-1" href="buckets/apt-lists">apt-lists</a></li>
|
<li><a tabindex="-1" href="buckets/apt-lists">apt-lists</a></li>
|
||||||
<li><a tabindex="-1" href="buckets/apt-cacher">apt-cacher</a></li>
|
<li><a tabindex="-1" href="buckets/apt-cacher">apt-cacher</a></li>
|
||||||
<li><a tabindex="-1" href="buckets/chef">Chef</a></li>
|
<li><a tabindex="-1" href="buckets/chef">Chef</a></li>
|
||||||
<li><a tabindex="-1" href="buckets/chef_rubygems">Chef Gems</a></li>
|
|
||||||
<li><a tabindex="-1" href="buckets/composer">Composer</a></li>
|
<li><a tabindex="-1" href="buckets/composer">Composer</a></li>
|
||||||
<li><a tabindex="-1" href="buckets/dnf">DNF</a></li>
|
|
||||||
<li><a tabindex="-1" href="buckets/bower">Bower</a></li>
|
|
||||||
<li><a tabindex="-1" href="buckets/pacman">Pacman</a></li>
|
<li><a tabindex="-1" href="buckets/pacman">Pacman</a></li>
|
||||||
<li><a tabindex="-1" href="buckets/npm">npm</a></li>
|
<li><a tabindex="-1" href="buckets/npm">npm</a></li>
|
||||||
<li><a tabindex="-1" href="buckets/rubygems">RubyGems</a></li>
|
<li><a tabindex="-1" href="buckets/rubygems">RubyGems</a></li>
|
||||||
<li><a tabindex="-1" href="buckets/rvm">rvm</a></li>
|
<li><a tabindex="-1" href="buckets/rvm">rvm</a></li>
|
||||||
<li><a tabindex="-1" href="buckets/yum">Yum</a></li>
|
<li><a tabindex="-1" href="buckets/yum">Yum</a></li>
|
||||||
<li><a tabindex="-1" href="buckets/zypper">Zypper</a></li>
|
<li><a tabindex="-1" href="buckets/zypper">Zypper</a></li>
|
||||||
<li><a tabindex="-1" href="buckets/pip">pip</a></li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="development">Development</a>
|
<a href="development">Development</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
|
||||||
<li><a href="https://gitter.im/fgrehm/vagrant-cachier" target="_blank">Chat</li>
|
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<ul class="nav navbar-nav navbar-right visible-md visible-lg">
|
<ul class="nav navbar-nav navbar-right visible-md visible-lg">
|
||||||
|
|
|
@ -33,20 +33,7 @@ module VagrantPlugins
|
||||||
def cache_root
|
def cache_root
|
||||||
@cache_root ||= case @env[:machine].config.cache.scope.to_sym
|
@cache_root ||= case @env[:machine].config.cache.scope.to_sym
|
||||||
when :box
|
when :box
|
||||||
@box_name = box_name
|
@env[:home_path].join('cache', box_name)
|
||||||
# Box is optional with docker provider
|
|
||||||
if @box_name.nil? && @env[:machine].provider_name.to_sym == :docker
|
|
||||||
@image_name = image_name
|
|
||||||
# Use the image name if it's set
|
|
||||||
if @image_name
|
|
||||||
bucket_name = @image_name.gsub(':', '-')
|
|
||||||
else
|
|
||||||
raise "Cachier plugin only supported with docker provider when image is used"
|
|
||||||
end
|
|
||||||
else
|
|
||||||
bucket_name = @box_name
|
|
||||||
end
|
|
||||||
@env[:home_path].join('cache', bucket_name)
|
|
||||||
when :machine
|
when :machine
|
||||||
@env[:machine].data_dir.parent.join('cache')
|
@env[:machine].data_dir.parent.join('cache')
|
||||||
else
|
else
|
||||||
|
@ -57,10 +44,6 @@ module VagrantPlugins
|
||||||
def box_name
|
def box_name
|
||||||
@env[:machine].config.vm.box
|
@env[:machine].config.vm.box
|
||||||
end
|
end
|
||||||
|
|
||||||
def image_name
|
|
||||||
@env[:machine].provider_config.image
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -90,16 +90,12 @@ end
|
||||||
require_relative "bucket/apt"
|
require_relative "bucket/apt"
|
||||||
require_relative "bucket/chef"
|
require_relative "bucket/chef"
|
||||||
require_relative "bucket/gem"
|
require_relative "bucket/gem"
|
||||||
require_relative "bucket/chef_gem"
|
|
||||||
require_relative "bucket/pacman"
|
require_relative "bucket/pacman"
|
||||||
require_relative "bucket/yum"
|
require_relative "bucket/yum"
|
||||||
require_relative "bucket/dnf"
|
|
||||||
require_relative "bucket/rvm"
|
require_relative "bucket/rvm"
|
||||||
require_relative "bucket/apt_cacher"
|
require_relative "bucket/apt_cacher"
|
||||||
require_relative "bucket/apt_lists"
|
require_relative "bucket/apt_lists"
|
||||||
require_relative "bucket/composer"
|
require_relative "bucket/composer"
|
||||||
require_relative "bucket/bower"
|
|
||||||
require_relative "bucket/npm"
|
require_relative "bucket/npm"
|
||||||
require_relative "bucket/zypper"
|
require_relative "bucket/zypper"
|
||||||
require_relative "bucket/generic"
|
require_relative "bucket/generic"
|
||||||
require_relative "bucket/pip"
|
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
module VagrantPlugins
|
|
||||||
module Cachier
|
|
||||||
class Bucket
|
|
||||||
class Bower < Bucket
|
|
||||||
def self.capability
|
|
||||||
:bower_path
|
|
||||||
end
|
|
||||||
|
|
||||||
def install
|
|
||||||
if guest.capability?(:bower_path)
|
|
||||||
if bower_path = guest.capability(:bower_path)
|
|
||||||
user_symlink(bower_path)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
@env[:ui].info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'Bower')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,25 +0,0 @@
|
||||||
module VagrantPlugins
|
|
||||||
module Cachier
|
|
||||||
class Bucket
|
|
||||||
class ChefGem < Bucket
|
|
||||||
def self.capability
|
|
||||||
:chef_gemdir
|
|
||||||
end
|
|
||||||
|
|
||||||
def install
|
|
||||||
if guest.capability?(:chef_gemdir)
|
|
||||||
if gemdir_path = guest.capability(:chef_gemdir)
|
|
||||||
prefix = gemdir_path.split('/').last
|
|
||||||
bucket_path = "/tmp/vagrant-cache/#{@name}/#{prefix}"
|
|
||||||
gem_cache_path = "#{gemdir_path}/cache"
|
|
||||||
|
|
||||||
symlink(gem_cache_path, bucket_path)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
@env[:ui].info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'ChefRubyGems')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,27 +0,0 @@
|
||||||
module VagrantPlugins
|
|
||||||
module Cachier
|
|
||||||
class Bucket
|
|
||||||
class Dnf < Bucket
|
|
||||||
def self.capability
|
|
||||||
:dnf_cache_dir
|
|
||||||
end
|
|
||||||
|
|
||||||
def install
|
|
||||||
if guest.capability?(:dnf_cache_dir)
|
|
||||||
if guest_path = guest.capability(:dnf_cache_dir)
|
|
||||||
return if @env[:cache_dirs].include?(guest_path)
|
|
||||||
|
|
||||||
# Ensure caching is enabled
|
|
||||||
comm.sudo("sed -i '/keepcache=/d' /etc/dnf/dnf.conf")
|
|
||||||
comm.sudo("sed -i '/^[main]/a keepcache=1' /etc/dnf/dnf.conf")
|
|
||||||
|
|
||||||
symlink(guest_path)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
@env[:ui].info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'DNF')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,22 +0,0 @@
|
||||||
module VagrantPlugins
|
|
||||||
module Cachier
|
|
||||||
class Bucket
|
|
||||||
class Pip < Bucket
|
|
||||||
def self.capability
|
|
||||||
:pip_cache_dir
|
|
||||||
end
|
|
||||||
|
|
||||||
def install
|
|
||||||
if guest.capability?(:pip_cache_dir)
|
|
||||||
if guest_path = guest.capability(:pip_cache_dir)
|
|
||||||
symlink("#{guest_path}/http", "/tmp/vagrant-cache/#{@name}/http")
|
|
||||||
symlink("#{guest_path}/wheels", "/tmp/vagrant-cache/#{@name}/wheels")
|
|
||||||
end
|
|
||||||
else
|
|
||||||
@env[:ui].info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'pip')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -8,14 +8,13 @@ module VagrantPlugins
|
||||||
|
|
||||||
def install
|
def install
|
||||||
if guest.capability?(:yum_cache_dir)
|
if guest.capability?(:yum_cache_dir)
|
||||||
if guest_path = guest.capability(:yum_cache_dir)
|
guest_path = guest.capability(:yum_cache_dir)
|
||||||
return if @env[:cache_dirs].include?(guest_path)
|
return if @env[:cache_dirs].include?(guest_path)
|
||||||
|
|
||||||
# Ensure caching is enabled
|
# Ensure caching is enabled
|
||||||
comm.sudo("sed -i 's/keepcache=0/keepcache=1/g' /etc/yum.conf")
|
comm.sudo("sed -i 's/keepcache=0/keepcache=1/g' /etc/yum.conf")
|
||||||
|
|
||||||
symlink(guest_path)
|
symlink(guest_path)
|
||||||
end
|
|
||||||
else
|
else
|
||||||
@env[:ui].info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'Yum')
|
@env[:ui].info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'Yum')
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
module VagrantPlugins
|
|
||||||
module Cachier
|
|
||||||
module Cap
|
|
||||||
module Linux
|
|
||||||
module BowerPath
|
|
||||||
def self.bower_path(machine)
|
|
||||||
bower_path = nil
|
|
||||||
machine.communicate.tap do |comm|
|
|
||||||
return unless comm.test('which bower')
|
|
||||||
comm.execute 'echo $HOME' do |buffer, output|
|
|
||||||
bower_path = output.chomp if buffer == :stdout
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return "#{bower_path}/.cache/bower"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -5,8 +5,8 @@ module VagrantPlugins
|
||||||
module ChefFileCachePath
|
module ChefFileCachePath
|
||||||
def self.chef_provisioner?(machine)
|
def self.chef_provisioner?(machine)
|
||||||
provisioners = machine.config.vm.provisioners
|
provisioners = machine.config.vm.provisioners
|
||||||
chef_provisioners = [:chef_solo, :chef_client, :chef_zero]
|
chef_provisioners = [:chef_solo, :chef_client]
|
||||||
compat_provisioners = provisioners.select { |p| chef_provisioners.include? p.name || p.type }
|
compat_provisioners = provisioners.keep_if { |p| chef_provisioners.include? p.name }
|
||||||
|
|
||||||
if compat_provisioners.size > 1
|
if compat_provisioners.size > 1
|
||||||
raise "One machine is using multiple chef provisioners, which is unsupported."
|
raise "One machine is using multiple chef provisioners, which is unsupported."
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
module VagrantPlugins
|
|
||||||
module Cachier
|
|
||||||
module Cap
|
|
||||||
module Linux
|
|
||||||
module ChefGemdir
|
|
||||||
def self.chef_gemdir(machine)
|
|
||||||
gemdir = nil
|
|
||||||
machine.communicate.tap do |comm|
|
|
||||||
return unless comm.test('test -f /opt/chef/embedded/bin/gem')
|
|
||||||
comm.execute '/opt/chef/embedded/bin/gem env gemdir' do |buffer, output|
|
|
||||||
gemdir = output.chomp if buffer == :stdout
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return gemdir
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -7,11 +7,8 @@ module VagrantPlugins
|
||||||
composer_path = nil
|
composer_path = nil
|
||||||
machine.communicate.tap do |comm|
|
machine.communicate.tap do |comm|
|
||||||
return unless comm.test('which php')
|
return unless comm.test('which php')
|
||||||
# on some VMs an extra new line seems to come out, so we loop over
|
|
||||||
# the output just in case
|
|
||||||
composer_path = ''
|
|
||||||
comm.execute 'echo $HOME' do |buffer, output|
|
comm.execute 'echo $HOME' do |buffer, output|
|
||||||
composer_path += output.chomp if buffer == :stdout
|
composer_path = output.chomp if buffer == :stdout
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return "#{composer_path}/.composer/cache"
|
return "#{composer_path}/.composer/cache"
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
module VagrantPlugins
|
|
||||||
module Cachier
|
|
||||||
module Cap
|
|
||||||
module Linux
|
|
||||||
module PipCacheDir
|
|
||||||
def self.pip_cache_dir(machine)
|
|
||||||
pip_cache_dir = nil
|
|
||||||
machine.communicate.tap do |comm|
|
|
||||||
return unless comm.test('which pip')
|
|
||||||
comm.execute 'echo $HOME' do |buffer, output|
|
|
||||||
pip_cache_dir = output.chomp if buffer == :stdout
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return "#{pip_cache_dir}/.cache/pip"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,18 +0,0 @@
|
||||||
module VagrantPlugins
|
|
||||||
module Cachier
|
|
||||||
module Cap
|
|
||||||
module RedHat
|
|
||||||
module DnfCacheDir
|
|
||||||
def self.dnf_cache_dir(machine)
|
|
||||||
dnf_cache_dir = nil
|
|
||||||
machine.communicate.tap do |comm|
|
|
||||||
return unless comm.test('which dnf')
|
|
||||||
dnf_cache_dir = '/var/cache/dnf'
|
|
||||||
end
|
|
||||||
return dnf_cache_dir
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -4,13 +4,7 @@ module VagrantPlugins
|
||||||
module RedHat
|
module RedHat
|
||||||
module YumCacheDir
|
module YumCacheDir
|
||||||
def self.yum_cache_dir(machine)
|
def self.yum_cache_dir(machine)
|
||||||
yum_cache_dir = nil
|
'/var/cache/yum'
|
||||||
machine.communicate.tap do |comm|
|
|
||||||
# In case yum is only forwarding to dnf do not cache
|
|
||||||
return unless not comm.test('yum --version 2>&1 | grep /usr/bin/dnf')
|
|
||||||
yum_cache_dir = '/var/cache/yum'
|
|
||||||
end
|
|
||||||
return yum_cache_dir
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,11 +6,6 @@ module VagrantPlugins
|
||||||
Cap::Linux::Gemdir
|
Cap::Linux::Gemdir
|
||||||
end
|
end
|
||||||
|
|
||||||
guest_capability 'linux', 'chef_gemdir' do
|
|
||||||
require_relative 'cap/linux/chef_gemdir'
|
|
||||||
Cap::Linux::ChefGemdir
|
|
||||||
end
|
|
||||||
|
|
||||||
guest_capability 'linux', 'rvm_path' do
|
guest_capability 'linux', 'rvm_path' do
|
||||||
require_relative 'cap/linux/rvm_path'
|
require_relative 'cap/linux/rvm_path'
|
||||||
Cap::Linux::RvmPath
|
Cap::Linux::RvmPath
|
||||||
|
@ -21,11 +16,6 @@ module VagrantPlugins
|
||||||
Cap::Linux::ComposerPath
|
Cap::Linux::ComposerPath
|
||||||
end
|
end
|
||||||
|
|
||||||
guest_capability 'linux', 'bower_path' do
|
|
||||||
require_relative 'cap/linux/bower_path'
|
|
||||||
Cap::Linux::BowerPath
|
|
||||||
end
|
|
||||||
|
|
||||||
guest_capability 'linux', 'chef_file_cache_path' do
|
guest_capability 'linux', 'chef_file_cache_path' do
|
||||||
require_relative 'cap/linux/chef_file_cache_path'
|
require_relative 'cap/linux/chef_file_cache_path'
|
||||||
Cap::Linux::ChefFileCachePath
|
Cap::Linux::ChefFileCachePath
|
||||||
|
@ -36,11 +26,6 @@ module VagrantPlugins
|
||||||
Cap::Linux::NpmCacheDir
|
Cap::Linux::NpmCacheDir
|
||||||
end
|
end
|
||||||
|
|
||||||
guest_capability 'linux', 'pip_cache_dir' do
|
|
||||||
require_relative 'cap/linux/pip_cache_dir'
|
|
||||||
Cap::Linux::PipCacheDir
|
|
||||||
end
|
|
||||||
|
|
||||||
guest_capability 'debian', 'apt_cache_dir' do
|
guest_capability 'debian', 'apt_cache_dir' do
|
||||||
require_relative 'cap/debian/apt_cache_dir'
|
require_relative 'cap/debian/apt_cache_dir'
|
||||||
Cap::Debian::AptCacheDir
|
Cap::Debian::AptCacheDir
|
||||||
|
@ -61,11 +46,6 @@ module VagrantPlugins
|
||||||
Cap::RedHat::YumCacheDir
|
Cap::RedHat::YumCacheDir
|
||||||
end
|
end
|
||||||
|
|
||||||
guest_capability 'redhat', 'dnf_cache_dir' do
|
|
||||||
require_relative 'cap/redhat/dnf_cache_dir'
|
|
||||||
Cap::RedHat::DnfCacheDir
|
|
||||||
end
|
|
||||||
|
|
||||||
guest_capability 'suse', 'yum_cache_dir' do
|
guest_capability 'suse', 'yum_cache_dir' do
|
||||||
# Disable Yum on suse guests
|
# Disable Yum on suse guests
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
module VagrantPlugins
|
module VagrantPlugins
|
||||||
module Cachier
|
module Cachier
|
||||||
VERSION = "1.2.1"
|
VERSION = "0.8.0"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -17,4 +17,16 @@ Gem::Specification.new do |spec|
|
||||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||||
spec.require_paths = ["lib"]
|
spec.require_paths = ["lib"]
|
||||||
|
|
||||||
|
spec.post_install_message = %Q{
|
||||||
|
Thanks for installing vagrant-cachier #{VagrantPlugins::Cachier::VERSION}!
|
||||||
|
|
||||||
|
If you are new to vagrant-cachier just follow along with the docs available
|
||||||
|
at http://fgrehm.viewdocs.io/vagrant-cachier.
|
||||||
|
|
||||||
|
If you are upgrading from a previous version, please note that plugin has gone
|
||||||
|
through many backwards incompatible changes recently. Please check out
|
||||||
|
https://github.com/fgrehm/vagrant-cachier/blob/master/CHANGELOG.md
|
||||||
|
before continuing and caching all the things :)
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue