Module: Kamal::Commands::App::Execution

Included in:
Kamal::Commands::App
Defined in:
lib/kamal/commands/app/execution.rb

Instance Method Summary collapse

Instance Method Details

#execute_in_existing_container(*command, interactive: false) ⇒ Object



2
3
4
5
6
7
# File 'lib/kamal/commands/app/execution.rb', line 2

def execute_in_existing_container(*command, interactive: false)
  docker :exec,
    ("-it" if interactive),
    container_name,
    *command
end

#execute_in_existing_container_over_ssh(*command, host:) ⇒ Object



20
21
22
# File 'lib/kamal/commands/app/execution.rb', line 20

def execute_in_existing_container_over_ssh(*command, host:)
  run_over_ssh execute_in_existing_container(*command, interactive: true), host: host
end

#execute_in_new_container(*command, interactive: false) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/kamal/commands/app/execution.rb', line 9

def execute_in_new_container(*command, interactive: false)
  docker :run,
    ("-it" if interactive),
    "--rm",
    *role_config&.env_args,
    *config.volume_args,
    *role_config&.option_args,
    config.absolute_image,
    *command
end

#execute_in_new_container_over_ssh(*command, host:) ⇒ Object



24
25
26
# File 'lib/kamal/commands/app/execution.rb', line 24

def execute_in_new_container_over_ssh(*command, host:)
  run_over_ssh execute_in_new_container(*command, interactive: true), host: host
end