vagrant-berkshelf 1.4.0.dev1 → 2.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -1
- data/CHANGELOG.md +33 -12
- data/CONTRIBUTING.md +1 -1
- data/Gemfile +5 -1
- data/README.md +5 -6
- data/lib/berkshelf/vagrant.rb +1 -1
- data/lib/berkshelf/vagrant/action.rb +1 -1
- data/lib/berkshelf/vagrant/action/install.rb +16 -10
- data/lib/berkshelf/vagrant/config.rb +11 -3
- data/lib/berkshelf/vagrant/env.rb +2 -5
- data/lib/berkshelf/vagrant/env_helpers.rb +1 -1
- data/lib/berkshelf/vagrant/version.rb +1 -1
- data/spec/unit/berkshelf/vagrant/config_spec.rb +3 -3
- data/vagrant-berkshelf.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86228fa24b97269de5159161b4548fec146cd4cf
|
4
|
+
data.tar.gz: c96edc36d6bc0303f7130dd0707dbfc51c39155c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d48d776c1437b35d853cab2ac2d204f82df395c523cf1a9b601776195b04ea28dc4d071b5d123d328c2b90e6880ce8cd823c7281b402cd5f7e0be1502920f99
|
7
|
+
data.tar.gz: bc0366f8b5c7b933ebdd1d57ae7ad9d5411464410ecb1f310cd78f6d1a7e6a196b7c794e325f0b7b9b4b2713c5f28d79e755d0a2d670fb4ba221341ca57b0d94
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,21 +1,42 @@
|
|
1
|
+
# 2.0.0
|
2
|
+
|
3
|
+
* Enhancements
|
4
|
+
* Support Vagrant 1.5.x
|
5
|
+
|
1
6
|
# 1.3.4
|
2
|
-
|
7
|
+
|
8
|
+
* Bug Fixes
|
9
|
+
* Fix undefined constant error when provisioning with Vagrant AWS
|
3
10
|
|
4
11
|
# 1.2.0
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
12
|
+
|
13
|
+
* Breaking Changes
|
14
|
+
* Rename to vagrant-berkshelf
|
15
|
+
|
16
|
+
* Enhancements
|
17
|
+
* Trigger the plugin also on `vagrant reload`
|
18
|
+
* Check Vagrant version to see if it's supported
|
19
|
+
* cookbooks uploaded via chef_client will be forced and not frozen
|
20
|
+
* Respect --no-provision flag
|
21
|
+
|
22
|
+
* Bug Fixes
|
23
|
+
* Fix bug with AWS provisioner
|
11
24
|
|
12
25
|
# 1.1.2
|
13
|
-
|
14
|
-
|
26
|
+
|
27
|
+
* Enhancements
|
28
|
+
* Support Vagrant 1.2
|
29
|
+
* Plugin defaults to enabled, if Berksfile exists.
|
15
30
|
|
16
31
|
# 1.1.0
|
17
|
-
|
32
|
+
|
33
|
+
* Enhancements
|
34
|
+
* Plugin defaults to disabled. Set 'config.berkshelf.enabled = true' in Vagrant config
|
18
35
|
|
19
36
|
# 1.0.0
|
20
|
-
|
21
|
-
|
37
|
+
|
38
|
+
* Breaking Changes
|
39
|
+
* Separated Berkshelf Vagrant plugin into it's own gem (this one)
|
40
|
+
|
41
|
+
* Enhancements
|
42
|
+
* Support Vagrant 1.1.x
|
data/CONTRIBUTING.md
CHANGED
data/Gemfile
CHANGED
@@ -3,7 +3,11 @@ source 'https://rubygems.org'
|
|
3
3
|
gemspec
|
4
4
|
|
5
5
|
group :development do
|
6
|
-
gem 'vagrant', github: 'mitchellh/vagrant'
|
6
|
+
gem 'vagrant', github: 'mitchellh/vagrant', tag: 'v1.5.2'
|
7
|
+
end
|
8
|
+
|
9
|
+
group :plugins do
|
10
|
+
gem "vagrant-berkshelf", path: "."
|
7
11
|
end
|
8
12
|
|
9
13
|
group :guard do
|
data/README.md
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
# vagrant-berkshelf
|
2
2
|
[![Gem Version](https://badge.fury.io/rb/vagrant-berkshelf.png)](http://badge.fury.io/rb/vagrant-berkshelf)
|
3
|
-
[![Build Status](https://travis-ci.org/
|
4
|
-
[![Dependency Status](https://gemnasium.com/
|
5
|
-
[![Code Climate](https://codeclimate.com/github/RiotGames/vagrant-berkshelf.png)](https://codeclimate.com/github/RiotGames/vagrant-berkshelf)
|
3
|
+
[![Build Status](https://travis-ci.org/berkshelf/vagrant-berkshelf.png?branch=master)](https://travis-ci.org/berkshelf/vagrant-berkshelf)
|
4
|
+
[![Dependency Status](https://gemnasium.com/berkshelf/vagrant-berkshelf.png)](https://gemnasium.com/berkshelf/vagrant-berkshelf)
|
6
5
|
|
7
6
|
A Vagrant plugin to add Berkshelf integration to the Chef provisioners
|
8
7
|
|
9
8
|
## Installation
|
10
9
|
|
11
|
-
Install Vagrant 1.
|
10
|
+
Install Vagrant 1.5.x from the [Vagrant downloads page](http://downloads.vagrantup.com/)
|
12
11
|
|
13
12
|
Install the Vagrant Berkshelf plugin
|
14
13
|
|
@@ -30,6 +29,6 @@ The plugin will look in your current working directory for your `Berksfile` by d
|
|
30
29
|
- Jamie Winsor (<jamie@vialstudios.com>)
|
31
30
|
- Michael Ivey (<michael.ivey@riotgames.com>)
|
32
31
|
|
33
|
-
Thank you to all of our [Contributors](https://github.com/
|
32
|
+
Thank you to all of our [Contributors](https://github.com/berkshelf/vagrant-berkshelf/graphs/contributors), testers, and users.
|
34
33
|
|
35
|
-
If you'd like to contribute, please see our [contribution guidelines](https://github.com/
|
34
|
+
If you'd like to contribute, please see our [contribution guidelines](https://github.com/berkshelf/vagrant-berkshelf/blob/master/CONTRIBUTING.md) first.
|
data/lib/berkshelf/vagrant.rb
CHANGED
@@ -20,7 +20,7 @@ module Berkshelf
|
|
20
20
|
require_relative 'vagrant/env'
|
21
21
|
require_relative 'vagrant/env_helpers'
|
22
22
|
|
23
|
-
|
23
|
+
TESTED_REQUIREMENTS = [">= 1.1", "< 1.5.0"]
|
24
24
|
|
25
25
|
class << self
|
26
26
|
# The path to where shelfs are created on the host machine to be mounted in
|
@@ -16,7 +16,7 @@ module Berkshelf
|
|
16
16
|
# this stack will find retrieve and resolve the cookbook dependencies describe
|
17
17
|
# in your configured Berksfile.
|
18
18
|
#
|
19
|
-
# Cookbooks will
|
19
|
+
# Cookbooks will install into a temporary directory, called a Shelf, and be mounted
|
20
20
|
# into the VM. This mounted path will be appended to the chef_solo.cookbooks_path value.
|
21
21
|
#
|
22
22
|
# @return [::Vagrant::Action::Builder]
|
@@ -17,14 +17,17 @@ module Berkshelf
|
|
17
17
|
end
|
18
18
|
|
19
19
|
unless berkshelf_enabled?(env)
|
20
|
-
if File.exist?(env
|
20
|
+
if File.exist?(berksfile_path(env))
|
21
21
|
warn_disabled_but_berksfile_exists(env)
|
22
22
|
end
|
23
23
|
|
24
24
|
return @app.call(env)
|
25
25
|
end
|
26
26
|
|
27
|
-
|
27
|
+
opts = env[:machine].config.berkshelf.to_hash.symbolize_keys
|
28
|
+
opts.delete(:except) if opts[:except].empty?
|
29
|
+
opts.delete(:only) if opts[:only].empty?
|
30
|
+
env[:berkshelf].berksfile = Berkshelf::Berksfile.from_file(berksfile_path(env), opts)
|
28
31
|
|
29
32
|
if chef_solo?(env)
|
30
33
|
install(env)
|
@@ -42,8 +45,7 @@ module Berkshelf
|
|
42
45
|
env[:berkshelf].ui.info "Updating Vagrant's berkshelf: '#{env[:berkshelf].shelf}'"
|
43
46
|
FileUtils.rm_rf(env[:berkshelf].shelf)
|
44
47
|
|
45
|
-
|
46
|
-
env[:berkshelf].berksfile.vendor(env[:berkshelf].shelf, opts)
|
48
|
+
env[:berkshelf].berksfile.vendor(env[:berkshelf].shelf)
|
47
49
|
end
|
48
50
|
|
49
51
|
def warn_disabled_but_berksfile_exists(env)
|
@@ -54,20 +56,24 @@ module Berkshelf
|
|
54
56
|
end
|
55
57
|
|
56
58
|
def check_vagrant_version(env)
|
57
|
-
unless vagrant_version_satisfies?(">= 1.
|
58
|
-
raise Berkshelf::VagrantWrapperError.new(RuntimeError.new("vagrant-berkshelf requires Vagrant 1.
|
59
|
+
unless vagrant_version_satisfies?(">= 1.5")
|
60
|
+
raise Berkshelf::VagrantWrapperError.new(RuntimeError.new("vagrant-berkshelf requires Vagrant 1.5 or later."))
|
59
61
|
end
|
60
62
|
|
61
|
-
unless vagrant_version_satisfies?(::Berkshelf::Vagrant::
|
63
|
+
unless vagrant_version_satisfies?(::Berkshelf::Vagrant::TESTED_REQUIREMENTS)
|
62
64
|
env[:berkshelf].ui.warn "This version of the Berkshelf plugin has not been fully tested on this version of Vagrant."
|
63
65
|
env[:berkshelf].ui.warn "You should check for a newer version of vagrant-berkshelf."
|
64
|
-
env[:berkshelf].ui.warn "If you encounter any errors with this version, please report them at https://github.com/
|
66
|
+
env[:berkshelf].ui.warn "If you encounter any errors with this version, please report them at https://github.com/berkshelf/vagrant-berkshelf/issues"
|
65
67
|
env[:berkshelf].ui.warn "You can also join the discussion in #berkshelf on Freenode."
|
66
68
|
end
|
67
69
|
end
|
68
70
|
|
69
|
-
def vagrant_version_satisfies?(
|
70
|
-
Gem::Requirement.new(
|
71
|
+
def vagrant_version_satisfies?(requirements)
|
72
|
+
Gem::Requirement.new(requirements).satisfied_by? Gem::Version.new(::Vagrant::VERSION)
|
73
|
+
end
|
74
|
+
|
75
|
+
def berksfile_path(env)
|
76
|
+
env[:machine].env.vagrantfile.config.berkshelf.berksfile_path
|
71
77
|
end
|
72
78
|
end
|
73
79
|
end
|
@@ -43,17 +43,19 @@ module Berkshelf
|
|
43
43
|
|
44
44
|
# @param [String] value
|
45
45
|
def berksfile_path=(value)
|
46
|
-
@berksfile_path =
|
46
|
+
@berksfile_path = value
|
47
47
|
end
|
48
48
|
|
49
49
|
# @param [String] value
|
50
50
|
def client_key=(value)
|
51
|
-
@client_key =
|
51
|
+
@client_key = value
|
52
52
|
end
|
53
53
|
|
54
54
|
alias_method :to_hash, :instance_variables_hash
|
55
55
|
|
56
56
|
def validate(machine)
|
57
|
+
@berksfile_path = File.expand_path(@berksfile_path, machine.env.root_path.to_s)
|
58
|
+
@client_key = File.expand_path(@client_key, machine.env.root_path.to_s)
|
57
59
|
errors = Array.new
|
58
60
|
|
59
61
|
unless [TrueClass, FalseClass].include?(enabled.class)
|
@@ -73,7 +75,7 @@ module Berkshelf
|
|
73
75
|
errors << "A value for berkshelf.empty and berkshelf.only cannot both be defined."
|
74
76
|
end
|
75
77
|
|
76
|
-
if machine.
|
78
|
+
if global_provisioners(machine).any? { |prov| prov.name == :chef_client }
|
77
79
|
if machine.config.berkshelf.node_name.nil?
|
78
80
|
errors << "A configuration must be set for chef.node_name when using the chef_client provisioner. Run 'berks configure' or edit your configuration."
|
79
81
|
end
|
@@ -86,6 +88,12 @@ module Berkshelf
|
|
86
88
|
|
87
89
|
{ "berkshelf configuration" => errors }
|
88
90
|
end
|
91
|
+
|
92
|
+
private
|
93
|
+
|
94
|
+
def global_provisioners(machine)
|
95
|
+
machine.env.vagrantfile.config.vm.provisioners
|
96
|
+
end
|
89
97
|
end
|
90
98
|
end
|
91
99
|
end
|
@@ -14,11 +14,8 @@ module Berkshelf
|
|
14
14
|
attr_accessor :config
|
15
15
|
|
16
16
|
def initialize
|
17
|
-
|
18
|
-
|
19
|
-
else
|
20
|
-
@ui = ::Vagrant::UI::Colored.new('Berkshelf')
|
21
|
-
end
|
17
|
+
@ui = ::Vagrant::UI::Colored.new
|
18
|
+
@ui.opts[:target] = 'Berkshelf'
|
22
19
|
@config = Berkshelf::Config.instance
|
23
20
|
end
|
24
21
|
end
|
@@ -9,7 +9,7 @@ module Berkshelf
|
|
9
9
|
#
|
10
10
|
# @return [String]
|
11
11
|
def cache_file(env)
|
12
|
-
File.join('.vagrant', 'machines', env[:machine].name.to_s, 'berkshelf')
|
12
|
+
File.expand_path(File.join('.vagrant', 'machines', env[:machine].name.to_s, 'berkshelf'), env[:root_path].to_s)
|
13
13
|
end
|
14
14
|
|
15
15
|
# Filter all of the provisioners of the given vagrant environment with the given name
|
@@ -47,7 +47,7 @@ describe Berkshelf::Vagrant::Config do
|
|
47
47
|
end
|
48
48
|
|
49
49
|
describe "#validate" do
|
50
|
-
let(:env) { double('env') }
|
50
|
+
let(:env) { double('env', root_path: Dir.pwd ) }
|
51
51
|
let(:config) { double('config', berkshelf: subject) }
|
52
52
|
let(:machine) { double('machine', config: config, env: env) }
|
53
53
|
|
@@ -58,7 +58,7 @@ describe Berkshelf::Vagrant::Config do
|
|
58
58
|
context "when the plugin is enabled" do
|
59
59
|
before(:each) do
|
60
60
|
subject.stub(enabled: true)
|
61
|
-
env.stub_chain(:
|
61
|
+
env.stub_chain(:vagrantfile, :config, :vm, :provisioners, :any?)
|
62
62
|
end
|
63
63
|
|
64
64
|
let(:result) { subject.validate(machine) }
|
@@ -81,7 +81,7 @@ describe Berkshelf::Vagrant::Config do
|
|
81
81
|
end
|
82
82
|
|
83
83
|
context "when the plugin is disabled" do
|
84
|
-
let(:machine) { double('machine') }
|
84
|
+
let(:machine) { double('machine', env: env) }
|
85
85
|
|
86
86
|
before do
|
87
87
|
subject.stub(enabled: false)
|
data/vagrant-berkshelf.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
spec.required_ruby_version = '>= 1.9.1'
|
21
21
|
|
22
|
-
spec.add_dependency 'berkshelf', '>= 3.0.0.
|
22
|
+
spec.add_dependency 'berkshelf', '>= 3.0.0.beta7'
|
23
23
|
|
24
24
|
spec.add_development_dependency 'spork', '~> 0.9'
|
25
25
|
spec.add_development_dependency 'rspec', '~> 2.13'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-berkshelf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamie Winsor
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-04-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: berkshelf
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - '>='
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 3.0.0.
|
20
|
+
version: 3.0.0.beta7
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - '>='
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 3.0.0.
|
27
|
+
version: 3.0.0.beta7
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: spork
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
124
|
version: 1.3.1
|
125
125
|
requirements: []
|
126
126
|
rubyforge_project:
|
127
|
-
rubygems_version: 2.0.
|
127
|
+
rubygems_version: 2.0.14
|
128
128
|
signing_key:
|
129
129
|
specification_version: 4
|
130
130
|
summary: A Vagrant plugin to add Berkshelf integration to the Chef provisioners
|