sambot 0.1.208 → 0.1.209
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ddfcb1d5014cb7c2d3b53f32144ae82f8da1985
|
4
|
+
data.tar.gz: 59dc36ed65dbfb54d679025cee33b33d01533881
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72e02ec95f3e69b20149f175a467dfaa6a3e9a2d57357b2d108fa4c73e760aaf7b1e11a0e157f3341cd5fda7115b93e8555e703a4309d79e03ecde6ed8e570a1
|
7
|
+
data.tar.gz: 9cc87e2f5e91fed56c92015d8d63e2a538c3f19dcfd3af9f71c6bf92436f602a2e9ca9277209dfcd23881b948a3b117ade746a4068d9ce515f141b0483037b1b
|
data/lib/sambot/chef/kitchen.rb
CHANGED
@@ -9,7 +9,7 @@ module Sambot
|
|
9
9
|
GENERATED_FILE = '.kitchen.yml'
|
10
10
|
|
11
11
|
def setup(cloud, config, vault_setup)
|
12
|
-
contents = generate_yml(cloud, config.name, config.available_platforms, config.suites, vault_setup)
|
12
|
+
contents = generate_yml(cloud, config.name, config.available_platforms, config.forwarded_ports, config.suites, vault_setup)
|
13
13
|
File.write(GENERATED_FILE, contents)
|
14
14
|
UI.debug("#{GENERATED_FILE} has been added to the cookbook.")
|
15
15
|
end
|
@@ -18,10 +18,10 @@ module Sambot
|
|
18
18
|
FS.delete(GENERATED_FILE)
|
19
19
|
end
|
20
20
|
|
21
|
-
def generate_yml(cloud, cookbook_name, platforms, suites = nil, vault_setup = nil)
|
21
|
+
def generate_yml(cloud, cookbook_name, platforms, forwarded_ports = [], suites = nil, vault_setup = nil)
|
22
22
|
raise ApplicationError, 'Missing platforms when trying to generate Test-Kitchen YAML.' unless platforms
|
23
23
|
raise ApplicationError, 'Missing cookbook name when trying to generate Test-Kitchen YAML.' unless cookbook_name
|
24
|
-
template = read_template(cloud, cookbook_name, platforms, vault_setup)
|
24
|
+
template = read_template(cloud, cookbook_name, platforms, vault_setup, forwarded_ports)
|
25
25
|
if suites
|
26
26
|
template['suites'] = Marshal.load(Marshal.dump(suites))
|
27
27
|
add_platform_identifier(template, cloud)
|
@@ -57,8 +57,8 @@ module Sambot
|
|
57
57
|
platform == 'local' ? runlist['local'] : runlist['dev']
|
58
58
|
end
|
59
59
|
|
60
|
-
def read_template(cloud, cookbook_name, platforms, vault_setup)
|
61
|
-
ctx = { platforms: platforms, name: cookbook_name, vault_setup: vault_setup }
|
60
|
+
def read_template(cloud, cookbook_name, platforms, vault_setup, forwarded_ports)
|
61
|
+
ctx = { platforms: platforms, name: cookbook_name, vault_setup: vault_setup, forwarded_ports: forwarded_ports }
|
62
62
|
result = Template.new("test_kitchen/#{cloud}.yml.erb").evaluate(ctx, pattern: '<!--% %-->')
|
63
63
|
YAML.safe_load(result)
|
64
64
|
end
|
data/lib/sambot/config.rb
CHANGED
@@ -8,6 +8,12 @@
|
|
8
8
|
#################################################################################
|
9
9
|
name: <%= @config.name %>
|
10
10
|
#################################################################################
|
11
|
+
# Add any ports you need to foward from the guest to the host. #
|
12
|
+
#################################################################################
|
13
|
+
forwarded_ports:
|
14
|
+
#- guest: 80
|
15
|
+
# host: 8080
|
16
|
+
#################################################################################
|
11
17
|
# The cookbook version. It will be added to the metadata.rb and needs to be #
|
12
18
|
# incremented whenever a new cookbook version needs to be pushed to the Chef #
|
13
19
|
# Server. #
|
@@ -19,6 +19,9 @@ platforms:
|
|
19
19
|
driver:
|
20
20
|
network:
|
21
21
|
- ["private_network", {ip: "192.168.255.10"}]
|
22
|
+
<!--% @forwarded_ports.each do |forwarded_port| %-->
|
23
|
+
- ["forwarded_port", {guest: <!--%= forwarded_port['guest'] %-->, host: <!--%= forwarded_port['host'] %-->}]
|
24
|
+
<!--% end %-->
|
22
25
|
<!--% end %-->
|
23
26
|
<!--% if @platforms.include?('windows') %-->
|
24
27
|
- name: windows-2012R2
|
data/lib/sambot/version.rb
CHANGED