Simplify domain language to just "boot" and unscoped config keys

This commit is contained in:
David Heinemeier Hansson
2023-05-02 13:11:31 +02:00
parent f055766918
commit c83b74dcb7
8 changed files with 23 additions and 22 deletions

View File

@@ -13,7 +13,7 @@ class Mrsk::Cli::App < Mrsk::Cli::Base
execute *MRSK.app.tag_current_as_latest
end
on(MRSK.hosts, **MRSK.group_strategy) do |host|
on(MRSK.hosts, **MRSK.boot_strategy) do |host|
roles = MRSK.roles_on(host)
roles.each do |role|

View File

@@ -51,9 +51,9 @@ class Mrsk::Commander
end
end
def group_strategy
if config.boot.group_limit.present?
{ in: :groups, limit: config.boot.group_limit, wait: config.boot.group_wait }
def boot_strategy
if config.boot.limit.present?
{ in: :groups, limit: config.boot.limit, wait: config.boot.wait }
else
{}
end

View File

@@ -4,8 +4,9 @@ class Mrsk::Configuration::Boot
@host_count = config.all_hosts.count
end
def group_limit
limit = @options["group_limit"]
def limit
limit = @options["limit"]
if limit.to_s.end_with?("%")
@host_count * limit.to_i / 100
else
@@ -13,7 +14,7 @@ class Mrsk::Configuration::Boot
end
end
def group_wait
@options["group_wait"]
def wait
@options["wait"]
end
end