Compare commits
No commits in common. "master" and "v1.2.0" have entirely different histories.
16 changed files with 13 additions and 172 deletions
|
@ -1,11 +1,3 @@
|
||||||
## [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)
|
## [1.2.0](https://github.com/fgrehm/vagrant-cachier/compare/v1.1.0...v1.2.0) (Jan 14, 2015)
|
||||||
|
|
||||||
FEATURES:
|
FEATURES:
|
||||||
|
|
|
@ -35,6 +35,7 @@ GIT
|
||||||
PATH
|
PATH
|
||||||
remote: .
|
remote: .
|
||||||
specs:
|
specs:
|
||||||
|
vagrant-cachier (1.2.0)
|
||||||
|
|
||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
|
@ -125,6 +126,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/) [](https://gitter.im/fgrehm/vagrant-cachier)
|
||||||
|
|
||||||
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,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
|
|
||||||
```
|
|
||||||
|
|
|
@ -89,7 +89,6 @@
|
||||||
<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/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/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>
|
||||||
|
@ -97,7 +96,6 @@
|
||||||
<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>
|
||||||
|
|
|
@ -93,7 +93,6 @@ require_relative "bucket/gem"
|
||||||
require_relative "bucket/chef_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"
|
||||||
|
@ -102,4 +101,3 @@ 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,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
|
||||||
|
|
|
@ -5,7 +5,7 @@ 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.select { |p| chef_provisioners.include? p.name || p.type }
|
||||||
|
|
||||||
if compat_provisioners.size > 1
|
if compat_provisioners.size > 1
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -36,11 +36,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 +56,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 = "1.2.0"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue