Add Role to the message

This commit is contained in:
Jacopo
2023-04-11 10:59:25 +02:00
parent 579b4cd9aa
commit 03d933d10b
2 changed files with 4 additions and 4 deletions

View File

@@ -142,10 +142,10 @@ class Mrsk::Cli::App < Mrsk::Cli::Base
stale_versions.each do |version| stale_versions.each do |version|
if stop if stop
puts_by_host host, "Stopping stale container with version #{version}" puts_by_host host, "Stopping stale container for role #{role} with version #{version}"
execute *MRSK.app(role: role).stop(version: version), raise_on_non_zero_exit: false execute *MRSK.app(role: role).stop(version: version), raise_on_non_zero_exit: false
else else
puts_by_host host, "Detected stale container with version #{version} (use `mrsk app stale_containers --stop` to stop)" puts_by_host host, "Detected stale container for role #{role} with version #{version} (use `mrsk app stale_containers --stop` to stop)"
end end
end end
end end

View File

@@ -50,7 +50,7 @@ class CliAppTest < CliTestCase
.returns("12345678\n87654321") .returns("12345678\n87654321")
run_command("stale_containers").tap do |output| run_command("stale_containers").tap do |output|
assert_match /Detected stale container with version 87654321/, output assert_match /Detected stale container for role web with version 87654321/, output
end end
end end
@@ -60,7 +60,7 @@ class CliAppTest < CliTestCase
.returns("12345678\n87654321") .returns("12345678\n87654321")
run_command("stale_containers", "--stop").tap do |output| run_command("stale_containers", "--stop").tap do |output|
assert_match /Stopping stale container with version 87654321/, output assert_match /Stopping stale container for role web with version 87654321/, output
assert_match /#{Regexp.escape("docker container ls --all --filter name=^app-web-87654321$ --quiet | xargs docker stop")}/, output assert_match /#{Regexp.escape("docker container ls --all --filter name=^app-web-87654321$ --quiet | xargs docker stop")}/, output
end end
end end