Merge pull request #349 from igor-alexandrov/login-to-registry-proactively

Login to the registry proactively before stoping Accessory and Traefik
This commit is contained in:
Donal McBreen
2023-07-19 13:36:00 +01:00
committed by GitHub
4 changed files with 18 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
class Mrsk::Cli::Accessory < Mrsk::Cli::Base
desc "boot [NAME]", "Boot new accessory service on host (use NAME=all to boot all accessories)"
def boot(name)
def boot(name, login: true)
mutating do
if name == "all"
MRSK.accessory_names.each { |accessory_name| boot(accessory_name) }
@@ -10,7 +10,7 @@ class Mrsk::Cli::Accessory < Mrsk::Cli::Base
upload(name)
on(accessory.hosts) do
execute *MRSK.registry.login
execute *MRSK.registry.login if login
execute *MRSK.auditor.record("Booted #{name} accessory"), verbosity: :debug
execute *accessory.run
end
@@ -53,9 +53,13 @@ class Mrsk::Cli::Accessory < Mrsk::Cli::Base
def reboot(name)
mutating do
with_accessory(name) do |accessory|
on(accessory.hosts) do
execute *MRSK.registry.login
end
stop(name)
remove_container(name)
boot(name)
boot(name, login: false)
end
end
end

View File

@@ -1,9 +1,9 @@
class Mrsk::Cli::Traefik < Mrsk::Cli::Base
desc "boot", "Boot Traefik on servers"
def boot
def boot(login: true)
mutating do
on(MRSK.traefik_hosts) do
execute *MRSK.registry.login
execute *MRSK.registry.login if login
execute *MRSK.traefik.run, raise_on_non_zero_exit: false
end
end
@@ -12,9 +12,13 @@ class Mrsk::Cli::Traefik < Mrsk::Cli::Base
desc "reboot", "Reboot Traefik on servers (stop container, remove container, start new container)"
def reboot
mutating do
on(MRSK.traefik_hosts) do
execute *MRSK.registry.login
end
stop
remove_container
boot
boot(login: false)
end
end