Get the current running container ID
This commit is contained in:
@@ -77,6 +77,11 @@ class Mrsk::Cli::App < Mrsk::Cli::Base
|
|||||||
def containers
|
def containers
|
||||||
on(MRSK.config.hosts) { |host| puts "App Host: #{host}\n" + capture(*MRSK.app.list_containers, verbosity: Logger::INFO) + "\n\n" }
|
on(MRSK.config.hosts) { |host| puts "App Host: #{host}\n" + capture(*MRSK.app.list_containers, verbosity: Logger::INFO) + "\n\n" }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
desc "current", "Return the current running container ID"
|
||||||
|
def current
|
||||||
|
on(MRSK.config.hosts) { |host| puts "App Host: #{host}\n" + capture(*MRSK.app.current_container_id, verbosity: Logger::INFO) + "\n\n" }
|
||||||
|
end
|
||||||
|
|
||||||
desc "logs", "Show last 100 log lines from app on servers"
|
desc "logs", "Show last 100 log lines from app on servers"
|
||||||
option :lines, type: :numeric, aliases: "-n", default: 1000, desc: "Number of log lines to pull from each server"
|
option :lines, type: :numeric, aliases: "-n", default: 1000, desc: "Number of log lines to pull from each server"
|
||||||
|
|||||||
@@ -19,6 +19,10 @@ class Mrsk::Commands::App < Mrsk::Commands::Base
|
|||||||
docker :start, "#{config.service}-#{version}"
|
docker :start, "#{config.service}-#{version}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def current_container_id
|
||||||
|
docker :ps, "-q", service_filter
|
||||||
|
end
|
||||||
|
|
||||||
def stop
|
def stop
|
||||||
[ "docker ps -q #{service_filter.join(" ")} | xargs docker stop" ]
|
[ "docker ps -q #{service_filter.join(" ")} | xargs docker stop" ]
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user