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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ab72184e8817a778c14479ba0240b7428e6ca499
4
- data.tar.gz: 014174b38d6b5bcbed17974029eaf14a117aa033
3
+ metadata.gz: 86228fa24b97269de5159161b4548fec146cd4cf
4
+ data.tar.gz: c96edc36d6bc0303f7130dd0707dbfc51c39155c
5
5
  SHA512:
6
- metadata.gz: 931caa0414264ce23e463c696d5dc6a54a53bae4385f65c6347632437d71510b30adf23dc7580c48df75300b011a26bbdb0469d8dfcefda97efc1598275b2d85
7
- data.tar.gz: 3ce49237284d8f3c84de4191b4432da3c25d3dfd2fe2d85e2021c187f1ffa06db6559acdf65ae78dbdb0d0efbf045cf4b0294d36eb1b4924e631fbba1a44a90c
6
+ metadata.gz: 2d48d776c1437b35d853cab2ac2d204f82df395c523cf1a9b601776195b04ea28dc4d071b5d123d328c2b90e6880ce8cd823c7281b402cd5f7e0be1502920f99
7
+ data.tar.gz: bc0366f8b5c7b933ebdd1d57ae7ad9d5411464410ecb1f310cd78f6d1a7e6a196b7c794e325f0b7b9b4b2713c5f28d79e755d0a2d670fb4ba221341ca57b0d94
@@ -1,6 +1,5 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.3
4
3
  - 2.0.0
5
4
  notifications:
6
5
  irc:
@@ -1,21 +1,42 @@
1
+ # 2.0.0
2
+
3
+ * Enhancements
4
+ * Support Vagrant 1.5.x
5
+
1
6
  # 1.3.4
2
- - Fix undefined constant error when provisioning with Vagrant AWS
7
+
8
+ * Bug Fixes
9
+ * Fix undefined constant error when provisioning with Vagrant AWS
3
10
 
4
11
  # 1.2.0
5
- - Rename to vagrant-berkshelf
6
- - Trigger the plugin also on `vagrant reload`
7
- - Check Vagrant version to see if it's supported
8
- - cookbooks uploaded via chef_client will be forced and not frozen
9
- - Fix bug with AWS provisioner
10
- - Respect --no-provision flag
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
- - Support Vagrant 1.2
14
- - Plugin defaults to enabled, if Berksfile exists.
26
+
27
+ * Enhancements
28
+ * Support Vagrant 1.2
29
+ * Plugin defaults to enabled, if Berksfile exists.
15
30
 
16
31
  # 1.1.0
17
- - Plugin defaults to disabled. Set 'config.berkshelf.enabled = true' in Vagrant config
32
+
33
+ * Enhancements
34
+ * Plugin defaults to disabled. Set 'config.berkshelf.enabled = true' in Vagrant config
18
35
 
19
36
  # 1.0.0
20
- - Separated Berkshelf Vagrant plugin into it's own gem (this one)
21
- - Support Vagrant 1.1.x
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
@@ -23,7 +23,7 @@ Install the latest version of [Bundler](http://gembundler.com)
23
23
 
24
24
  Clone the project
25
25
 
26
- $ git clone git://github.com/RiotGames/vagrant-berkshelf.git
26
+ $ git clone git://github.com/berkshelf/vagrant-berkshelf.git
27
27
 
28
28
  and run:
29
29
 
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/RiotGames/vagrant-berkshelf.png?branch=master)](https://travis-ci.org/RiotGames/vagrant-berkshelf)
4
- [![Dependency Status](https://gemnasium.com/RiotGames/vagrant-berkshelf.png)](https://gemnasium.com/RiotGames/vagrant-berkshelf)
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.2.x from the [Vagrant downloads page](http://downloads.vagrantup.com/)
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/RiotGames/vagrant-berkshelf/graphs/contributors), testers, and users.
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/RiotGames/vagrant-berkshelf/blob/master/CONTRIBUTING.md) first.
34
+ If you'd like to contribute, please see our [contribution guidelines](https://github.com/berkshelf/vagrant-berkshelf/blob/master/CONTRIBUTING.md) first.
@@ -20,7 +20,7 @@ module Berkshelf
20
20
  require_relative 'vagrant/env'
21
21
  require_relative 'vagrant/env_helpers'
22
22
 
23
- TESTED_CONSTRAINT = "~> 1.2.0"
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 installed into a temporary directory, called a Shelf, and mounted
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[:global_config].berkshelf.berksfile_path)
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
- env[:berkshelf].berksfile = Berkshelf::Berksfile.from_file(env[:global_config].berkshelf.berksfile_path)
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
- opts = env[:machine].config.berkshelf.to_hash.symbolize_keys
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.1")
58
- raise Berkshelf::VagrantWrapperError.new(RuntimeError.new("vagrant-berkshelf requires Vagrant 1.1 or later."))
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::TESTED_CONSTRAINT)
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/RiotGames/vagrant-berkshelf/issues"
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?(requirement)
70
- Gem::Requirement.new(requirement).satisfied_by? Gem::Version.new(::Vagrant::VERSION)
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 = File.expand_path(value)
46
+ @berksfile_path = value
47
47
  end
48
48
 
49
49
  # @param [String] value
50
50
  def client_key=(value)
51
- @client_key = File.expand_path(value)
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.env.config_global.vm.provisioners.any? { |prov| prov.name == :chef_client }
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
- if Gem::Version.new(::Vagrant::VERSION) >= Gem::Version.new("1.2")
18
- @ui = ::Vagrant::UI::Colored.new.scope('Berkshelf')
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
@@ -1,5 +1,5 @@
1
1
  module Berkshelf
2
2
  module Vagrant
3
- VERSION = "1.4.0.dev1"
3
+ VERSION = "2.0.0.rc1"
4
4
  end
5
5
  end
@@ -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(:config_global, :vm, :provisioners, :any?)
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)
@@ -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.beta3'
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: 1.4.0.dev1
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: 2013-11-08 00:00:00.000000000 Z
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.beta3
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.beta3
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.3
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