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: f315027f7ca27415c1931d6d6d4399c31e16fc00
4
- data.tar.gz: 5305bd9878804fb3ce2080d35c2055b0fa70379c
3
+ metadata.gz: 5ddfcb1d5014cb7c2d3b53f32144ae82f8da1985
4
+ data.tar.gz: 59dc36ed65dbfb54d679025cee33b33d01533881
5
5
  SHA512:
6
- metadata.gz: fbf8e148425a41102e7959b6650a0c865dc46374bba4d629e6c1bbd628adddfcc4086d5f92f21a70d6db3fc9b4d65de4a549101af303892f35ce3f212e913096
7
- data.tar.gz: 3254e6267282bd325fc0a4f6613a1ec74cab7c1b7725b8432b655c0d6ddfd78ca6c5d376b33d6380c758f66be5d2f69027ae381e0193791d67862f04db1adaf6
6
+ metadata.gz: 72e02ec95f3e69b20149f175a467dfaa6a3e9a2d57357b2d108fa4c73e760aaf7b1e11a0e157f3341cd5fda7115b93e8555e703a4309d79e03ecde6ed8e570a1
7
+ data.tar.gz: 9cc87e2f5e91fed56c92015d8d63e2a538c3f19dcfd3af9f71c6bf92436f602a2e9ca9277209dfcd23881b948a3b117ade746a4068d9ce515f141b0483037b1b
@@ -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
@@ -51,6 +51,10 @@ module Sambot
51
51
  platforms
52
52
  end
53
53
 
54
+ def forwarded_ports
55
+ @opts['forwarded_ports'] || []
56
+ end
57
+
54
58
  def gems
55
59
  @opts['gems'] || []
56
60
  end
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sambot
4
- VERSION = '0.1.208'
4
+ VERSION = '0.1.209'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sambot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.208
4
+ version: 0.1.209
5
5
  platform: ruby
6
6
  authors:
7
7
  - Olivier Kouame