Class: Wrapbox::Runner::Docker::Cli

Inherits:
Thor
  • Object
show all
Defined in:
lib/wrapbox/runner/docker.rb

Instance Method Summary collapse

Instance Method Details

#run_cmd(*args) ⇒ Object



104
105
106
107
108
109
110
111
112
113
# File 'lib/wrapbox/runner/docker.rb', line 104

def run_cmd(*args)
  repo = Wrapbox::ConfigRepository.new.tap { |r| r.load_yaml(options[:config]) }
  config = repo.get(options[:config_name])
  config.runner = :docker
  runner = config.build_runner
  environments = options[:environments].to_s.split(/,\s*/).map { |kv| kv.split("=") }.map do |k, v|
    {name: k, value: v}
  end
  runner.run_cmd(args, environments: environments)
end