Expand arguments to be more self-explanatory in logs

This commit is contained in:
David Heinemeier Hansson
2023-02-19 18:11:06 +01:00
parent 5299826146
commit 5898fdd8f4
12 changed files with 77 additions and 77 deletions

View File

@@ -3,7 +3,7 @@ class Mrsk::Commands::App < Mrsk::Commands::Base
role = config.role(role)
docker :run,
"-d",
"--detach",
"--restart unless-stopped",
"--log-opt", "max-size=#{MAX_LOG_SIZE}",
"--name", service_with_version,
@@ -30,7 +30,7 @@ class Mrsk::Commands::App < Mrsk::Commands::Base
def logs(since: nil, lines: nil, grep: nil)
pipe \
current_container_id,
"xargs docker logs#{" --since #{since}" if since}#{" -n #{lines}" if lines} 2>&1",
"xargs docker logs#{" --since #{since}" if since}#{" --tail #{lines}" if lines} 2>&1",
("grep '#{grep}'" if grep)
end
@@ -38,7 +38,7 @@ class Mrsk::Commands::App < Mrsk::Commands::Base
run_over_ssh \
pipe(
current_container_id,
"xargs docker logs -t -n 10 -f 2>&1",
"xargs docker logs --timestamps --tail 10 --follow 2>&1",
(%(grep "#{grep}") if grep)
),
host: host
@@ -72,7 +72,7 @@ class Mrsk::Commands::App < Mrsk::Commands::Base
def current_container_id
docker :ps, "-q", *service_filter
docker :ps, "--quiet", *service_filter
end
def current_running_version
@@ -97,7 +97,7 @@ class Mrsk::Commands::App < Mrsk::Commands::Base
def list_containers
docker :container, :ls, "-a", *service_filter
docker :container, :ls, "--all", *service_filter
end
def list_container_names
@@ -111,7 +111,7 @@ class Mrsk::Commands::App < Mrsk::Commands::Base
end
def remove_containers
docker :container, :prune, "-f", *service_filter
docker :container, :prune, "--force", *service_filter
end
def list_images
@@ -119,7 +119,7 @@ class Mrsk::Commands::App < Mrsk::Commands::Base
end
def remove_images
docker :image, :prune, "-a", "-f", *service_filter
docker :image, :prune, "--all", "--force", *service_filter
end