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