Class: ContainerRunner

Inherits:
Object
  • Object
show all
Includes:
GithubActions::Colorizer
Defined in:
lib/tasks/container_runner.rb

Overview

Run a client in Docker container

Instance Method Summary collapse

Methods included from GithubActions::Colorizer

#error, #info, #stage, #success, #warning

Instance Method Details

#run(client) ⇒ Object

start a container, copy the sources there and run “rake run”

Parameters:

  • client (String, nil)

    the client name, nil or empty string = find the client automatically



30
31
32
33
34
35
36
37
38
39
40
# File 'lib/tasks/container_runner.rb', line 30

def run(client)
  container = find_container
  container.pull
  container.start
  container.copy_current_dir

  cmd = client ? "rake run[#{client}]" : "rake run"
  container.run(cmd)

  container.stop
end