Class: PlanExecutor::Config
Instance Method Summary
collapse
#[], #env_keys, #initialize, #load_file_config, #natural?, #ssl_keys
Instance Method Details
#config_keys ⇒ Object
9
10
11
|
# File 'lib/plan_executor/config.rb', line 9
def config_keys
super + %w[modulepath workers orchestrator-url]
end
|
#defaults ⇒ Object
13
14
15
16
17
18
|
# File 'lib/plan_executor/config.rb', line 13
def defaults
super.merge(
'port' => 62659,
'workers' => 1
)
end
|
#load_env_config ⇒ Object
28
29
30
31
32
33
34
|
# File 'lib/plan_executor/config.rb', line 28
def load_env_config
env_keys.each do |key|
transformed_key = "BOLT_#{key.tr('-', '_').upcase}"
next unless ENV.key?(transformed_key)
@data[key] = ENV[transformed_key]
end
end
|
#required_keys ⇒ Object
24
25
26
|
# File 'lib/plan_executor/config.rb', line 24
def required_keys
super + ['orchestrator-url']
end
|
#service_name ⇒ Object
20
21
22
|
# File 'lib/plan_executor/config.rb', line 20
def service_name
'plan-executor'
end
|
#validate ⇒ Object
36
37
38
39
40
41
|
# File 'lib/plan_executor/config.rb', line 36
def validate
super
unless natural?(@data['workers'])
raise Bolt::ValidationError, "Configured 'workers' must be a positive integer"
end
end
|