187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
|
# File 'lib/hako/cli.rb', line 187
def parser
@parser ||= OptionParser.new do |opts|
opts.banner = 'hako oneshot [OPTIONS] FILE COMMAND ARG...'
opts.version = VERSION
opts.on('-t', '--tag=TAG', 'Specify tag') { |v| @tag = v }
opts.on('-n', '--dry-run', 'Enable dry-run mode') { @dry_run = true }
opts.on('-c', '--container=NAME', 'Additional container name to start with the app container') { |v| @containers << v }
opts.on('-v', '--verbose', 'Enable verbose logging') { @verbose = true }
opts.on('--no-wait', 'Run Docker container in background and return task information depending on scheduler (experimental)') { @no_wait = true }
opts.on('-e', '--env=NAME=VAL', 'Add environment variable') do |arg|
k, v = arg.split('=', 2)
@env[k] = v
end
opts.on('--app-cpu=VAL', Integer, 'Override the default cpu for the app container') { |v| @overrides.app_cpu = v }
opts.on('--app-memory=VAL', Integer, 'Override the default memory for the app container') { |v| @overrides.app_memory = v }
opts.on('--app-memory-reservation=VAL', Integer, 'Override the default memory reservation for the app container') { |v| @overrides.app_memory_reservation = v }
end
end
|