Class: KuberKit::Shell::Commands::DockerComposeCommands

Inherits:
Object
  • Object
show all
Defined in:
lib/kuber_kit/shell/commands/docker_compose_commands.rb

Instance Method Summary collapse

Instance Method Details

#run(shell, path, service:, command:, interactive: false) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/kuber_kit/shell/commands/docker_compose_commands.rb', line 2

def run(shell, path, service:, command:, interactive: false)
  command_parts = [
    "docker-compose",
    "-f #{path}",
    "run",
    service,
    command
  ]
  
  if interactive
    shell.interactive!(command_parts.join(" "))
  else
    shell.exec!(command_parts.join(" "))
  end
end