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 +4 -4
- data/lib/wrapbox/runner/docker.rb +8 -1
- data/lib/wrapbox/runner/ecs.rb +9 -1
- data/lib/wrapbox/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec530a0b68981cc7a90bcd451c4a54d371d275dd
|
4
|
+
data.tar.gz: 17e6212341e23126993ebde697b9ddccf4ecc397
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
data/lib/wrapbox/runner/ecs.rb
CHANGED
@@ -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
|
-
|
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
|
data/lib/wrapbox/version.rb
CHANGED