kitchen-vagrant 0.15.0 → 0.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +22 -1
- data/CHANGELOG.md +95 -19
- data/Gemfile +7 -4
- data/Guardfile +23 -0
- data/README.md +195 -81
- data/Rakefile +23 -7
- data/kitchen-vagrant.gemspec +16 -8
- data/lib/kitchen/driver/vagrant.rb +218 -123
- data/lib/kitchen/driver/vagrant_version.rb +1 -1
- data/spec/kitchen/driver/vagrant_spec.rb +1165 -0
- data/spec/spec_helper.rb +33 -0
- data/templates/Vagrantfile.erb +64 -4
- metadata +62 -16
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
#
|
3
|
+
# Author:: Fletcher Nichol (<fnichol@nichol.ca>)
|
4
|
+
#
|
5
|
+
# Copyright (C) 2015, Fletcher Nichol
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
|
19
|
+
if ENV["CODECLIMATE_REPO_TOKEN"]
|
20
|
+
require "codeclimate-test-reporter"
|
21
|
+
CodeClimate::TestReporter.start
|
22
|
+
elsif ENV["COVERAGE"]
|
23
|
+
require "simplecov"
|
24
|
+
SimpleCov.profiles.define "gem" do
|
25
|
+
command_name "Specs"
|
26
|
+
|
27
|
+
add_filter ".gem/"
|
28
|
+
add_filter "/spec/"
|
29
|
+
|
30
|
+
add_group "Libraries", "/lib/"
|
31
|
+
end
|
32
|
+
SimpleCov.start "gem"
|
33
|
+
end
|
data/templates/Vagrantfile.erb
CHANGED
@@ -1,19 +1,47 @@
|
|
1
|
+
<% config[:vagrantfiles].each do |vagrantfile| %>
|
2
|
+
require "<%= vagrantfile %>"
|
3
|
+
<% end %>
|
4
|
+
|
1
5
|
Vagrant.configure("2") do |c|
|
6
|
+
c.berkshelf.enabled = false if Vagrant.has_plugin?("vagrant-berkshelf")
|
2
7
|
c.vm.box = "<%= config[:box] %>"
|
8
|
+
|
9
|
+
<% if config[:box_url] %>
|
3
10
|
c.vm.box_url = "<%= config[:box_url] %>"
|
11
|
+
<% end %>
|
12
|
+
|
13
|
+
<% if config[:box_version] %>
|
14
|
+
c.vm.box_version = "<%= config[:box_version] %>"
|
15
|
+
<% end %>
|
16
|
+
|
17
|
+
<% if config[:box_check_update] %>
|
18
|
+
c.vm.box_check_update = "<%= config[:box_check_update] %>"
|
19
|
+
<% end %>
|
4
20
|
|
5
21
|
<% if config[:vm_hostname] %>
|
6
22
|
c.vm.hostname = "<%= config[:vm_hostname] %>"
|
7
23
|
<% end %>
|
24
|
+
|
25
|
+
<% if config[:communicator] %>
|
26
|
+
c.vm.communicator = "<%= config[:communicator] %>"
|
27
|
+
<% end %>
|
28
|
+
|
8
29
|
<% if config[:guest] %>
|
9
|
-
c.vm.guest = <%= config[:guest] %>
|
30
|
+
c.vm.guest = "<%= config[:guest] %>"
|
10
31
|
<% end %>
|
32
|
+
|
11
33
|
<% if config[:username] %>
|
12
34
|
c.ssh.username = "<%= config[:username] %>"
|
13
35
|
<% end %>
|
36
|
+
<% if config[:password] %>
|
37
|
+
c.ssh.password = "<%= config[:password] %>"
|
38
|
+
<% end %>
|
14
39
|
<% if config[:ssh_key] %>
|
15
40
|
c.ssh.private_key_path = "<%= config[:ssh_key] %>"
|
16
41
|
<% end %>
|
42
|
+
<% config[:ssh].each do |key, value| %>
|
43
|
+
c.ssh.<%= key %> = <%= value %>
|
44
|
+
<% end %>
|
17
45
|
|
18
46
|
<% Array(config[:network]).each do |opts| %>
|
19
47
|
c.vm.network(:<%= opts[0] %>, <%= opts[1..-1].join(", ") %>)
|
@@ -25,12 +53,44 @@ Vagrant.configure("2") do |c|
|
|
25
53
|
<% end %>
|
26
54
|
|
27
55
|
c.vm.provider :<%= config[:provider] %> do |p|
|
56
|
+
<% case config[:provider]
|
57
|
+
when "virtualbox", /^vmware_/
|
58
|
+
if config[:gui] == true || config[:gui] == false %>
|
59
|
+
p.gui = <%= config[:gui] %>
|
60
|
+
<% end
|
61
|
+
end %>
|
28
62
|
<% config[:customize].each do |key, value| %>
|
29
63
|
<% case config[:provider]
|
30
|
-
when "
|
31
|
-
p
|
32
|
-
<% when "
|
64
|
+
when "libvirt" %>
|
65
|
+
p.<%= key %> = <%= value%>
|
66
|
+
<% when "lxc" %>
|
67
|
+
<% if key == :container_name %>
|
68
|
+
p.container_name = <%= value == ":machine" ? value : "\"#{value}\"" %>
|
69
|
+
<% elsif key == :backingstore %>
|
70
|
+
p.backingstore = "<%= value %>"
|
71
|
+
<% elsif key == :backingstore_options %>
|
72
|
+
<% config[:customize][:backingstore_options].each do |opt, opt_val| %>
|
73
|
+
p.backingstore_option "--<%= opt %>", "<%= opt_val %>"
|
74
|
+
<% end %>
|
75
|
+
<% else %>
|
76
|
+
p.customize "<%= key %>", "<%= value %>"
|
77
|
+
<% end %>
|
78
|
+
<% when "managed" %>
|
79
|
+
<% if key == :server %>
|
80
|
+
p.server = "<%= value %>"
|
81
|
+
<% end %>
|
82
|
+
<% when "parallels" %>
|
83
|
+
p.customize ["set", :id, "--<%= key.to_s.gsub('_', '-') %>", "<%= value %>"]
|
84
|
+
<% when "rackspace" %>
|
33
85
|
p.<%= key %> = "<%= value%>"
|
86
|
+
<% when "softlayer" %>
|
87
|
+
<% if key == :disk_capacity %>
|
88
|
+
p.<%= key %> = <%= value %>
|
89
|
+
<% else %>
|
90
|
+
p.<%= key %> = "<%= value %>"
|
91
|
+
<% end %>
|
92
|
+
<% when "virtualbox" %>
|
93
|
+
p.customize ["modifyvm", :id, "--<%= key %>", "<%= value %>"]
|
34
94
|
<% when /^vmware_/ %>
|
35
95
|
<% if key == :memory %>
|
36
96
|
<% unless config[:customize].include?(:memsize) %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-vagrant
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.16.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fletcher Nichol
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-kitchen
|
@@ -25,21 +25,21 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: countloc
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
33
|
+
version: '0.4'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
40
|
+
version: '0.4'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
@@ -53,19 +53,61 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '3.2'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '3.2'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: simplecov
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0.9'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.9'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: finstyle
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 1.4.0
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 1.4.0
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: cane
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 2.6.2
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 2.6.2
|
69
111
|
description: Kitchen::Driver::Vagrant - A Vagrant Driver for Test Kitchen.
|
70
112
|
email:
|
71
113
|
- fnichol@nichol.ca
|
@@ -77,12 +119,15 @@ files:
|
|
77
119
|
- ".travis.yml"
|
78
120
|
- CHANGELOG.md
|
79
121
|
- Gemfile
|
122
|
+
- Guardfile
|
80
123
|
- LICENSE
|
81
124
|
- README.md
|
82
125
|
- Rakefile
|
83
126
|
- kitchen-vagrant.gemspec
|
84
127
|
- lib/kitchen/driver/vagrant.rb
|
85
128
|
- lib/kitchen/driver/vagrant_version.rb
|
129
|
+
- spec/kitchen/driver/vagrant_spec.rb
|
130
|
+
- spec/spec_helper.rb
|
86
131
|
- templates/Vagrantfile.erb
|
87
132
|
homepage: https://github.com/test-kitchen/kitchen-vagrant/
|
88
133
|
licenses:
|
@@ -104,9 +149,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
104
149
|
version: '0'
|
105
150
|
requirements: []
|
106
151
|
rubyforge_project:
|
107
|
-
rubygems_version: 2.
|
152
|
+
rubygems_version: 2.4.5
|
108
153
|
signing_key:
|
109
154
|
specification_version: 4
|
110
155
|
summary: Kitchen::Driver::Vagrant - A Vagrant Driver for Test Kitchen.
|
111
|
-
test_files:
|
112
|
-
|
156
|
+
test_files:
|
157
|
+
- spec/kitchen/driver/vagrant_spec.rb
|
158
|
+
- spec/spec_helper.rb
|