wrapbox 0.4.0 → 0.4.1

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: 67a6e2d03ab3ecd91eb20638f7ea5faa3b42e6e9
4
- data.tar.gz: d64a6d52580d830f3c48dad77885fb1d344baaa9
3
+ metadata.gz: ec530a0b68981cc7a90bcd451c4a54d371d275dd
4
+ data.tar.gz: 17e6212341e23126993ebde697b9ddccf4ecc397
5
5
  SHA512:
6
- metadata.gz: dc8c3a0b68c1d636a501cf205fa41741c526b1c432d2e2e09875b181a4bf3e3b3d8e2ff754ef341f7fcf6d98426a1a187eafdcca8d6c03241ecc7f531625d982
7
- data.tar.gz: 800d8fedf7f5d0aea0850b3d5158699d0107ccfda0eb2f00319e331af2e38d48ba0e18a274bca0c08f6f008cda1761d2cfb70e018bd40342c912ce70043cb9bd
6
+ metadata.gz: eccc15faf35450e79202e8b134b9fd304ca66bb3a8179e976b6e181f83cc69d2e4a613326ab2fd872eb268c9485dbc2eb7feb0bf2147985d4b913feaabda0523
7
+ data.tar.gz: 2f3623dbb0aa16b3b37b22e0e06e0eacf985f21be5c12b8d1bf217234c3c9e36773bf53cc53429f76b9ae4ff3a5401da89548369183750e1a1eedb8b7ab702af
@@ -101,6 +101,8 @@ module Wrapbox
101
101
  desc "run_cmd [shell command]", "Run shell on docker"
102
102
  method_option :config, aliases: "-f", required: true, banner: "YAML_FILE", desc: "yaml file path"
103
103
  method_option :config_name, aliases: "-n", required: true, default: "default"
104
+ method_option :cpu, type: :numeric
105
+ method_option :memory, type: :numeric
104
106
  method_option :environments, aliases: "-e"
105
107
  def run_cmd(*args)
106
108
  repo = Wrapbox::ConfigRepository.new.tap { |r| r.load_yaml(options[:config]) }
@@ -110,7 +112,12 @@ module Wrapbox
110
112
  environments = options[:environments].to_s.split(/,\s*/).map { |kv| kv.split("=") }.map do |k, v|
111
113
  {name: k, value: v}
112
114
  end
113
- runner.run_cmd(args, environments: environments)
115
+ if options[:cpu] || options[:memory]
116
+ container_definition_overrides = {cpu: options[:cpu], memory: options[:memory]}.reject { |_, v| v.nil? }
117
+ else
118
+ container_definition_overrides = {}
119
+ end
120
+ runner.run_cmd(args, environments: environments, container_definition_overrides: container_definition_overrides)
114
121
  end
115
122
  end
116
123
  end
@@ -263,6 +263,7 @@ module Wrapbox
263
263
  end
264
264
  end
265
265
 
266
+ @logger.debug("Container Definitions: #{container_definitions}")
266
267
  register_retry_count = 0
267
268
  begin
268
269
  client.register_task_definition({
@@ -361,6 +362,8 @@ module Wrapbox
361
362
  method_option :config, aliases: "-f", required: true, banner: "YAML_FILE", desc: "yaml file path"
362
363
  method_option :config_name, aliases: "-n", required: true, default: "default"
363
364
  method_option :cluster, aliases: "-c"
365
+ method_option :cpu, type: :numeric
366
+ method_option :memory, type: :numeric
364
367
  method_option :environments, aliases: "-e"
365
368
  method_option :task_role_arn
366
369
  method_option :timeout, type: :numeric
@@ -385,7 +388,12 @@ module Wrapbox
385
388
  execution_retry: options[:execution_retry],
386
389
  max_retry_interval: options[:max_retry_interval]
387
390
  }.reject { |_, v| v.nil? }
388
- runner.run_cmd(args, environments: environments, **run_options)
391
+ if options[:cpu] || options[:memory]
392
+ container_definition_overrides = {cpu: options[:cpu], memory: options[:memory]}.reject { |_, v| v.nil? }
393
+ else
394
+ container_definition_overrides = {}
395
+ end
396
+ runner.run_cmd(args, environments: environments, container_definition_overrides: container_definition_overrides, **run_options)
389
397
  end
390
398
  end
391
399
  end
@@ -1,3 +1,3 @@
1
1
  module Wrapbox
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wrapbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - joker1007