Module: Kamal::Commands::App::Execution
- Included in:
- Kamal::Commands::App
- Defined in:
- lib/kamal/commands/app/execution.rb
Instance Method Summary collapse
- #execute_in_existing_container(*command, interactive: false, env:) ⇒ Object
- #execute_in_existing_container_over_ssh(*command, env:) ⇒ Object
- #execute_in_new_container(*command, interactive: false, env:) ⇒ Object
- #execute_in_new_container_over_ssh(*command, env:) ⇒ Object
Instance Method Details
#execute_in_existing_container(*command, interactive: false, env:) ⇒ Object
2 3 4 5 6 7 8 |
# File 'lib/kamal/commands/app/execution.rb', line 2 def execute_in_existing_container(*command, interactive: false, env:) docker :exec, ("-it" if interactive), *argumentize("--env", env), container_name, *command end |
#execute_in_existing_container_over_ssh(*command, env:) ⇒ Object
23 24 25 |
# File 'lib/kamal/commands/app/execution.rb', line 23 def execute_in_existing_container_over_ssh(*command, env:) run_over_ssh execute_in_existing_container(*command, interactive: true, env: env), host: host end |
#execute_in_new_container(*command, interactive: false, env:) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/kamal/commands/app/execution.rb', line 10 def execute_in_new_container(*command, interactive: false, env:) docker :run, ("-it" if interactive), "--rm", "--network", "kamal", *role&.env_args(host), *argumentize("--env", env), *config.volume_args, *role&.option_args, config.absolute_image, *command end |
#execute_in_new_container_over_ssh(*command, env:) ⇒ Object
27 28 29 |
# File 'lib/kamal/commands/app/execution.rb', line 27 def execute_in_new_container_over_ssh(*command, env:) run_over_ssh execute_in_new_container(*command, interactive: true, env: env), host: host end |