vagrant-cachier 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 79be67fe8e7e56705fd0cfd49d71c1e72f87a704
4
- data.tar.gz: 928f3031d27f68421a37743f14720540e540091f
3
+ metadata.gz: ab08abfed390c7fdb1fee3ff7abcb2364db6f021
4
+ data.tar.gz: 6318c61700889dcb13f31d7f45d9cf37aae611a2
5
5
  SHA512:
6
- metadata.gz: 40753db496aef5ba65bfff06fbe17cc6bcdd19249bbe4268a7938f883769364a8bca878fa2437dca4280e0f49979f6c040a7c8910d5e63c129c49ce0ffd9c341
7
- data.tar.gz: b142bd61c5819f9f7de5255103c1ebe48ef3693e3f5e52192970a765d798f0db50d0bcf981cb65bb960617224e6b04ba30650c28987639c7aeaf67b7a4b87274
6
+ metadata.gz: 3ddd07cf38a67043d0e0381e713689b3c1e78fd74747d50af1f8cec45b2a4ab54b26ce82a9da876ecc0ee3630b00144eff4411c6b83803ac9005aaaf33e0cfc8
7
+ data.tar.gz: dffe7d326e42b6ca46154dda1f743b7ce3638a843afdb646a967c6243deb4b585bf1d4bbd9a907ab8b994af2708b25e14c39ce8a9fea17b9a81f694616c36dd7
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [0.5.0](https://github.com/fgrehm/vagrant-cachier/compare/v0.4.1...v0.5.0) (Nov 8, 2013)
2
+
3
+ FEATURES:
4
+
5
+ - Support for [zypper] [GH-54]
6
+
1
7
  ## [0.4.1](https://github.com/fgrehm/vagrant-cachier/compare/v0.4.0...v0.4.1) (Oct 27, 2013)
2
8
 
3
9
  BUG FIXES:
data/Gemfile.lock CHANGED
@@ -31,7 +31,7 @@ GIT
31
31
  PATH
32
32
  remote: .
33
33
  specs:
34
- vagrant-cachier (0.4.1)
34
+ vagrant-cachier (0.5.0)
35
35
 
36
36
  GEM
37
37
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -142,7 +142,20 @@ _Please note that to avoid re-downloading packages, you should avoid `apt-get cl
142
142
  as much as possible in order to make a better use of the cache, even if you are
143
143
  packaging a box_
144
144
 
145
- ##### Yum
145
+ ##### Zypper
146
+
147
+ ```ruby
148
+ Vagrant.configure("2") do |config|
149
+ config.vm.box = 'some-suse-box'
150
+ config.cache.enable :zypper
151
+ end
152
+ ```
153
+
154
+ Used by SuSE guests, will get configured under guest's `/var/cache/zypp/packages`. It will
155
+ also [make sure](lib/vagrant-cachier/bucket/zypper.rb#L20) that `keep-packages` is enabled
156
+ for all repositories.
157
+
158
+ ###### Yum
146
159
 
147
160
  ```ruby
148
161
  Vagrant.configure("2") do |config|
@@ -14,9 +14,6 @@ Vagrant.configure("2") do |config|
14
14
  config.cache.auto_detect = true
15
15
  config.cache.enable_nfs = true
16
16
 
17
- config.vm.provider :virtualbox do |_, vb|
18
- vb.vm.network :private_network, ip: "192.168.50.123"
19
- end
20
17
 
21
18
  config.omnibus.chef_version = :latest
22
19
  config.vm.provision :chef_solo do |chef|
@@ -62,6 +59,10 @@ Vagrant.configure("2") do |config|
62
59
  fi
63
60
  '
64
61
 
62
+ configure_private_network = lambda do |node, suffix|
63
+ node.vm.network :private_network, ip: "192.168.50.#{suffix}"
64
+ end
65
+
65
66
  debian_like_configs = lambda do |debian|
66
67
  # Here we have the RubyGems cache bucket configured to the right path, so we
67
68
  # bundle the project
@@ -74,22 +75,26 @@ Vagrant.configure("2") do |config|
74
75
  config.vm.define :ubuntu do |ubuntu|
75
76
  ubuntu.vm.box = "quantal64"
76
77
  debian_like_configs.call ubuntu
78
+ configure_private_network.call ubuntu, 10
77
79
  end
78
80
 
79
81
  config.vm.define :lucid do |lucid|
80
82
  lucid.vm.box = "lucid64"
81
83
  debian_like_configs.call lucid
84
+ configure_private_network.call lucid, 11
82
85
  end
83
86
 
84
87
  config.vm.define :debian do |debian|
85
88
  debian.vm.box = "squeeze64"
86
89
  debian.vm.box_url = 'http://f.willianfernandes.com.br/vagrant-boxes/DebianSqueeze64.box'
87
90
  debian_like_configs.call debian
91
+ configure_private_network.call debian, 12
88
92
  end
89
93
 
90
94
  config.vm.define :centos do |centos|
91
95
  centos.vm.box = 'centos6_64'
92
96
  centos.vm.box_url = 'http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.4-x86_64-v20130309.box'
97
+ configure_private_network.call centos, 13
93
98
  # Here we have the RubyGems cache bucket configured to the right path, so we
94
99
  # bundle the project
95
100
  centos.vm.provision :shell, inline: '
@@ -100,8 +105,24 @@ Vagrant.configure("2") do |config|
100
105
  config.vm.define :arch do |arch|
101
106
  arch.vm.box = 'arch64'
102
107
  arch.vm.box_url = 'http://vagrant.pouss.in/archlinux_2012-07-02.box'
108
+ configure_private_network.call arch, 14
103
109
  arch.vm.provision :shell, inline: '
104
110
  pacman -Syu --noconfirm libffi git
105
111
  HOME=/home/vagrant su -p vagrant -l -c "cd /vagrant && bundle"'
106
112
  end
113
+
114
+ # Please note that we are not able to install chef on the VM, so when bringing
115
+ # this up we should always pass in `--provision-with=shell`
116
+ #
117
+ # TODO: Find out how to install chef on this or other box or find one that has
118
+ # it pre installed
119
+ config.vm.define :opensuse do |suse|
120
+ suse.vm.box = 'opensuse-12'
121
+ suse.vm.box_url = 'http://sourceforge.net/projects/opensusevagrant/files/12.3/opensuse-12.3-64.box/download'
122
+ configure_private_network.call suse, 15
123
+ suse.cache.enable_nfs = false
124
+ # This seems to not be working
125
+ suse.omnibus.chef_version = nil
126
+ suse.vm.provision :shell, inline: 'time zypper install -y git'
127
+ end
107
128
  end
@@ -0,0 +1,36 @@
1
+ module VagrantPlugins
2
+ module Cachier
3
+ class Bucket
4
+ class Zypper < Bucket
5
+ def self.capability
6
+ :zypper_cache_dir
7
+ end
8
+
9
+ def install
10
+ machine = @env[:machine]
11
+ guest = machine.guest
12
+
13
+ if guest.capability?(:zypper_cache_dir)
14
+ guest_path = guest.capability(:zypper_cache_dir)
15
+
16
+ @env[:cache_dirs] << guest_path
17
+
18
+ machine.communicate.tap do |comm|
19
+ # Ensure caching is enabled
20
+ comm.sudo("zypper modifyrepo --keep-packages --all")
21
+
22
+ comm.execute("mkdir -p /tmp/vagrant-cache/#{@name}")
23
+ unless comm.test("test -L #{guest_path}")
24
+ comm.sudo("rm -rf #{guest_path}")
25
+ comm.sudo("mkdir -p `dirname #{guest_path}`")
26
+ comm.sudo("ln -s /tmp/vagrant-cache/#{@name} #{guest_path}")
27
+ end
28
+ end
29
+ else
30
+ @env[:ui].info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'Zypper')
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -42,3 +42,4 @@ require_relative "bucket/rvm"
42
42
  require_relative "bucket/apt_cacher"
43
43
  require_relative "bucket/composer"
44
44
  require_relative "bucket/npm"
45
+ require_relative "bucket/zypper"
@@ -0,0 +1,14 @@
1
+ module VagrantPlugins
2
+ module Cachier
3
+ module Cap
4
+ module SuSE
5
+ module ZypperCacheDir
6
+ def self.zypper_cache_dir(machine)
7
+ # TODO: Find out if there is a config file we can read from
8
+ '/var/cache/zypp/packages'
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -56,11 +56,20 @@ module VagrantPlugins
56
56
  Cap::RedHat::YumCacheDir
57
57
  end
58
58
 
59
+ guest_capability 'suse', 'yum_cache_dir' do
60
+ # Disable Yum on suse guests
61
+ end
62
+
59
63
  guest_capability 'arch', 'pacman_cache_dir' do
60
64
  require_relative 'cap/arch/pacman_cache_dir'
61
65
  Cap::Arch::PacmanCacheDir
62
66
  end
63
67
 
68
+ guest_capability 'suse', 'zypper_cache_dir' do
69
+ require_relative 'cap/suse/zypper_cache_dir'
70
+ Cap::SuSE::ZypperCacheDir
71
+ end
72
+
64
73
  # TODO: This should be generic, we don't want to hard code every single
65
74
  # possible provider action class that Vagrant might have
66
75
  ensure_single_cache_root = lambda do |hook|
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module Cachier
3
- VERSION = "0.4.1"
3
+ VERSION = "0.5.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-cachier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fabio Rehm
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-28 00:00:00.000000000 Z
11
+ date: 2013-11-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Speed up vagrant boxes provisioning
14
14
  email:
@@ -40,6 +40,7 @@ files:
40
40
  - lib/vagrant-cachier/bucket/pacman.rb
41
41
  - lib/vagrant-cachier/bucket/rvm.rb
42
42
  - lib/vagrant-cachier/bucket/yum.rb
43
+ - lib/vagrant-cachier/bucket/zypper.rb
43
44
  - lib/vagrant-cachier/cap/arch/pacman_cache_dir.rb
44
45
  - lib/vagrant-cachier/cap/debian/apt_cache_dir.rb
45
46
  - lib/vagrant-cachier/cap/debian/apt_cacher_dir.rb
@@ -49,6 +50,7 @@ files:
49
50
  - lib/vagrant-cachier/cap/linux/npm_cache_dir.rb
50
51
  - lib/vagrant-cachier/cap/linux/rvm_path.rb
51
52
  - lib/vagrant-cachier/cap/redhat/yum_cache_dir.rb
53
+ - lib/vagrant-cachier/cap/suse/zypper_cache_dir.rb
52
54
  - lib/vagrant-cachier/config.rb
53
55
  - lib/vagrant-cachier/errors.rb
54
56
  - lib/vagrant-cachier/plugin.rb