Merge pull request #1544 from prullmann/kamal-exec-piping
Allow piping into kamal exec #1485
This commit is contained in:
@@ -56,14 +56,14 @@ class Kamal::Commands::Accessory < Kamal::Commands::Base
|
||||
|
||||
def execute_in_existing_container(*command, interactive: false)
|
||||
docker :exec,
|
||||
("-it" if interactive),
|
||||
(docker_interactive_args if interactive),
|
||||
service_name,
|
||||
*command
|
||||
end
|
||||
|
||||
def execute_in_new_container(*command, interactive: false)
|
||||
docker :run,
|
||||
("-it" if interactive),
|
||||
(docker_interactive_args if interactive),
|
||||
"--rm",
|
||||
*network_args,
|
||||
*env_args,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module Kamal::Commands::App::Execution
|
||||
def execute_in_existing_container(*command, interactive: false, env:)
|
||||
docker :exec,
|
||||
("-it" if interactive),
|
||||
(docker_interactive_args if interactive),
|
||||
*argumentize("--env", env),
|
||||
container_name,
|
||||
*command
|
||||
@@ -9,7 +9,7 @@ module Kamal::Commands::App::Execution
|
||||
|
||||
def execute_in_new_container(*command, interactive: false, detach: false, env:)
|
||||
docker :run,
|
||||
("-it" if interactive),
|
||||
(docker_interactive_args if interactive),
|
||||
("--detach" if detach),
|
||||
("--rm" unless detach),
|
||||
"--network", "kamal",
|
||||
|
||||
@@ -122,5 +122,9 @@ module Kamal::Commands
|
||||
def ensure_local_buildx_installed
|
||||
docker :buildx, "version"
|
||||
end
|
||||
|
||||
def docker_interactive_args
|
||||
STDIN.isatty ? "-it" : "-i"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user