Join in run_over_ssh instead of all over
This commit is contained in:
@@ -64,11 +64,11 @@ class Mrsk::Commands::Accessory < Mrsk::Commands::Base
|
||||
end
|
||||
|
||||
def execute_in_existing_container_over_ssh(*command)
|
||||
run_over_ssh execute_in_existing_container(*command, interactive: true).join(" ")
|
||||
run_over_ssh execute_in_existing_container(*command, interactive: true)
|
||||
end
|
||||
|
||||
def execute_in_new_container_over_ssh(*command)
|
||||
run_over_ssh execute_in_new_container(*command, interactive: true).join(" ")
|
||||
run_over_ssh execute_in_new_container(*command, interactive: true)
|
||||
end
|
||||
|
||||
def run_over_ssh(command)
|
||||
|
||||
@@ -35,11 +35,13 @@ class Mrsk::Commands::App < Mrsk::Commands::Base
|
||||
end
|
||||
|
||||
def follow_logs(host:, grep: nil)
|
||||
run_over_ssh pipe(
|
||||
current_container_id,
|
||||
"xargs docker logs -t -n 10 -f 2>&1",
|
||||
(%(grep "#{grep}") if grep)
|
||||
).join(" "), host: host
|
||||
run_over_ssh \
|
||||
pipe(
|
||||
current_container_id,
|
||||
"xargs docker logs -t -n 10 -f 2>&1",
|
||||
(%(grep "#{grep}") if grep)
|
||||
),
|
||||
host: host
|
||||
end
|
||||
|
||||
|
||||
@@ -62,11 +64,11 @@ class Mrsk::Commands::App < Mrsk::Commands::Base
|
||||
end
|
||||
|
||||
def execute_in_existing_container_over_ssh(*command, host:)
|
||||
run_over_ssh execute_in_existing_container(*command, interactive: true).join(" "), host: host
|
||||
run_over_ssh execute_in_existing_container(*command, interactive: true), host: host
|
||||
end
|
||||
|
||||
def execute_in_new_container_over_ssh(*command, host:)
|
||||
run_over_ssh execute_in_new_container(*command, interactive: true).join(" "), host: host
|
||||
run_over_ssh execute_in_new_container(*command, interactive: true), host: host
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ module Mrsk::Commands
|
||||
@config = config
|
||||
end
|
||||
|
||||
def run_over_ssh(command, host:)
|
||||
"ssh -t #{config.ssh_user}@#{host} '#{command}'"
|
||||
def run_over_ssh(*command, host:)
|
||||
"ssh -t #{config.ssh_user}@#{host} '#{command.join(" ")}'"
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Reference in New Issue
Block a user