bcome 0.1.3 → 0.1.4

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: 74a0b74d4c91fe7b0cb925f90991b9a39db9c974
4
- data.tar.gz: de595006dc81df83c71d3b857d7a46256bf45068
3
+ metadata.gz: 91c96e99720b24cef61f7ba3ce161eb701289410
4
+ data.tar.gz: b1e99f33e302403a8e9a98855b0eeba2d68ace1f
5
5
  SHA512:
6
- metadata.gz: c6cd53a6ceb112912b195578072785d7af42454377f7026acaf604959c04606f73653c395425e83b062f5cbc8991d74a98f2b005d65e4ae878de5215891666b7
7
- data.tar.gz: 837a73262d6cac7ff0af4609dc86920b39c3dc621878585236a4bf77ff1a8dfdaa812ef835dfdcdad96fe8794fd50948424e2d952e537748324d32183f332d4e
6
+ metadata.gz: 90e7dc76e7c6dcf52801d101f6e009a998f56480cb3576a4d3abef2da4bda5d6c77ff2e09f616b91d5a81c8c5c9a426e04a074f763925d27cdaf9dfa78e3c6b9
7
+ data.tar.gz: e80bed4ab0d1a02123485e3905bf737a4b43d7ab15870a1d4c51a185205a036852c538179abcc8f13b53318d29b1a63ebd7d528a1b8ad6839f6f4a17f8e0d963
data/lib/bcome/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Bcome
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -5,9 +5,9 @@ module ::Bcome::Orchestrator::CommandGroup
5
5
  super + [:bcome_command]
6
6
  end
7
7
 
8
- def execute!(current_context_machines)
9
- ::Bcome::Orchestrator::CustomCommand.send(@bcome_command, current_context_machines)
10
- end
8
+ def execute!(current_context_machines, is_bootstrap)
9
+ ::Bcome::Orchestrator::CustomCommand.send(@bcome_command, current_context_machines, is_bootstrap)
10
+ end
11
11
 
12
12
  end
13
13
  end
@@ -19,14 +19,14 @@ module ::Bcome::Orchestrator::CommandGroup
19
19
  @commands ||= set_commands
20
20
  end
21
21
 
22
- def execute!(current_context_machines)
22
+ def execute!(current_context_machines, bootstrap)
23
23
  # Per command group
24
24
  @direct_command_groups.each do |direct_command_group|
25
25
  # Per unique machine instance
26
- current_context_machines.each do |machine|
26
+ machines.each do |machine|
27
27
  kommands = []
28
28
  direct_command_group.command_instances.flatten.each do |command_instance|
29
- kommands << ::Bcome::Command.new(:command => command_instance.cmd, :instance => machine, :bootstrap => command_instance.bootstrap, :success_exit_codes => command_instance.success_exit_codes)
29
+ kommands << ::Bcome::Command.new(:command => command_instance.cmd, :instance => machine, :bootstrap => bootstrap, :success_exit_codes => command_instance.success_exit_codes)
30
30
  end
31
31
 
32
32
  begin
@@ -20,7 +20,7 @@ module ::Bcome::Orchestrator
20
20
 
21
21
  end
22
22
 
23
- attr_reader :command_groups, :recipe_identifier, :description
23
+ attr_reader :command_groups, :recipe_identifier, :description, :bootstrap
24
24
 
25
25
  include ::Bcome::Orchestrator::ValidateAndSet
26
26
 
@@ -30,17 +30,25 @@ module ::Bcome::Orchestrator
30
30
  end
31
31
 
32
32
  def json_attributes
33
- [:recipe_identifier, :description]
33
+ [:recipe_identifier, :description, :bootstrap]
34
34
  end
35
35
 
36
+ def optional_json_attributes
37
+ [:bootstrap]
38
+ end
39
+
36
40
  def execute!(current_context_machines)
37
41
  @command_groups.each do |command_group|
38
42
  puts "\nExecuting command group".informational
39
- command_group.execute!(current_context_machines)
43
+ command_group.execute!(current_context_machines, as_bootstrap)
40
44
  puts "\n"
41
45
  end
42
46
  end
43
47
 
48
+ def as_bootstrap
49
+ bootstrap ? true : false
50
+ end
51
+
44
52
  def set_command_groups(json, node_targets, all_machines, direct_commands)
45
53
  commands_json = json[:commands]
46
54
  raise "Expecting commands within an Orchestrator recipe as an Array" unless commands_json.is_a?(Array)
@@ -2,7 +2,7 @@ module ::Bcome::Orchestrator::ValidateAndSet
2
2
 
3
3
  def validate_and_set(json)
4
4
  json_attributes.each{|attribute|
5
- raise "Missing attribute #{attribute} in #{json.inspect}" unless json.has_key?(attribute)
5
+ raise "Missing attribute #{attribute} in #{json.inspect}" unless json.has_key?(attribute) if !json.has_key?(attribute) && !optional_json_attributes.include?(attribute)
6
6
  instance_variable_set("@#{attribute}".to_sym, json[attribute])
7
7
  }
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bcome
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guillaume Roderick (Webzakimbo)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-02 00:00:00.000000000 Z
11
+ date: 2016-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk