Merge pull request #164 from basecamp/accessory-hosts-or-roles

Run accessories on multiple hosts or roles
This commit is contained in:
David Heinemeier Hansson
2023-03-28 14:31:24 +02:00
committed by GitHub
10 changed files with 165 additions and 56 deletions

View File

@@ -1,7 +1,7 @@
class Mrsk::Commands::Accessory < Mrsk::Commands::Base
attr_reader :accessory_config
delegate :service_name, :image, :host, :port, :files, :directories, :publish_args, :env_args, :volume_args,
:label_args, :option_args, to: :accessory_config
delegate :service_name, :image, :hosts, :port, :files, :directories, :cmd,
:publish_args, :env_args, :volume_args, :label_args, :option_args, to: :accessory_config
def initialize(config, name:)
super(config)
@@ -19,7 +19,8 @@ class Mrsk::Commands::Accessory < Mrsk::Commands::Base
*volume_args,
*label_args,
*option_args,
image
image,
cmd
end
def start
@@ -75,7 +76,7 @@ class Mrsk::Commands::Accessory < Mrsk::Commands::Base
end
def run_over_ssh(command)
super command, host: host
super command, host: hosts.first
end