Class: Wrapbox::Configuration
- Inherits:
-
Struct
- Object
- Struct
- Wrapbox::Configuration
- Defined in:
- lib/wrapbox/configuration.rb
Constant Summary collapse
- AVAILABLE_RUNNERS =
%i(docker ecs)
Instance Attribute Summary collapse
-
#additional_container_definitions ⇒ Object
Returns the value of attribute additional_container_definitions.
-
#cluster ⇒ Object
Returns the value of attribute cluster.
-
#container_definition ⇒ Object
Returns the value of attribute container_definition.
-
#keep_container ⇒ Object
Returns the value of attribute keep_container.
-
#name ⇒ Object
Returns the value of attribute name.
-
#region ⇒ Object
Returns the value of attribute region.
-
#retry ⇒ Object
Returns the value of attribute retry.
-
#retry_interval ⇒ Object
Returns the value of attribute retry_interval.
-
#retry_interval_multiplier ⇒ Object
Returns the value of attribute retry_interval_multiplier.
-
#revision ⇒ Object
Returns the value of attribute revision.
-
#runner ⇒ Object
Returns the value of attribute runner.
-
#task_role_arn ⇒ Object
Returns the value of attribute task_role_arn.
Class Method Summary collapse
Instance Method Summary collapse
- #build_runner ⇒ Object
-
#initialize(*args) ⇒ Configuration
constructor
A new instance of Configuration.
- #run(class_name, method_name, args, **options) ⇒ Object
- #run_cmd(*cmd, **options) ⇒ Object
Constructor Details
#initialize(*args) ⇒ Configuration
Returns a new instance of Configuration.
38 39 40 |
# File 'lib/wrapbox/configuration.rb', line 38 def initialize(*args) super end |
Instance Attribute Details
#additional_container_definitions ⇒ Object
Returns the value of attribute additional_container_definitions
5 6 7 |
# File 'lib/wrapbox/configuration.rb', line 5 def additional_container_definitions @additional_container_definitions end |
#cluster ⇒ Object
Returns the value of attribute cluster
5 6 7 |
# File 'lib/wrapbox/configuration.rb', line 5 def cluster @cluster end |
#container_definition ⇒ Object
Returns the value of attribute container_definition
5 6 7 |
# File 'lib/wrapbox/configuration.rb', line 5 def container_definition @container_definition end |
#keep_container ⇒ Object
Returns the value of attribute keep_container
5 6 7 |
# File 'lib/wrapbox/configuration.rb', line 5 def keep_container @keep_container end |
#name ⇒ Object
Returns the value of attribute name
5 6 7 |
# File 'lib/wrapbox/configuration.rb', line 5 def name @name end |
#region ⇒ Object
Returns the value of attribute region
5 6 7 |
# File 'lib/wrapbox/configuration.rb', line 5 def region @region end |
#retry ⇒ Object
Returns the value of attribute retry
5 6 7 |
# File 'lib/wrapbox/configuration.rb', line 5 def retry @retry end |
#retry_interval ⇒ Object
Returns the value of attribute retry_interval
5 6 7 |
# File 'lib/wrapbox/configuration.rb', line 5 def retry_interval @retry_interval end |
#retry_interval_multiplier ⇒ Object
Returns the value of attribute retry_interval_multiplier
5 6 7 |
# File 'lib/wrapbox/configuration.rb', line 5 def retry_interval_multiplier @retry_interval_multiplier end |
#revision ⇒ Object
Returns the value of attribute revision
5 6 7 |
# File 'lib/wrapbox/configuration.rb', line 5 def revision @revision end |
#runner ⇒ Object
Returns the value of attribute runner
5 6 7 |
# File 'lib/wrapbox/configuration.rb', line 5 def runner @runner end |
#task_role_arn ⇒ Object
Returns the value of attribute task_role_arn
5 6 7 |
# File 'lib/wrapbox/configuration.rb', line 5 def task_role_arn @task_role_arn end |
Class Method Details
.load_config(config) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/wrapbox/configuration.rb', line 19 def self.load_config(config) new( config["name"], config["revision"], config["runner"] ? config["runner"].to_sym : :docker, config["cluster"], config["region"], config["retry"] || 0, config["retry_interval"] || 1, config["retry_interval_multiplier"] || 2, config["container_definition"].deep_symbolize_keys, config["additional_container_definitions"] || [], config["task_role_arn"], config["keep_container"] ) end |
Instance Method Details
#build_runner ⇒ Object
42 43 44 45 46 |
# File 'lib/wrapbox/configuration.rb', line 42 def build_runner raise "#{runner} is unsupported runner" unless AVAILABLE_RUNNERS.include?(runner.to_sym) require "wrapbox/runner/#{runner}" Wrapbox::Runner.const_get(runner.to_s.camelcase).new(to_h) end |
#run(class_name, method_name, args, **options) ⇒ Object
48 49 50 |
# File 'lib/wrapbox/configuration.rb', line 48 def run(class_name, method_name, args, **) build_runner.run(class_name, method_name, args, **) end |
#run_cmd(*cmd, **options) ⇒ Object
52 53 54 |
# File 'lib/wrapbox/configuration.rb', line 52 def run_cmd(*cmd, **) build_runner.run_cmd(*cmd, **) end |