Class: Flotte::CLI::Service

Inherits:
Thor
  • Object
show all
Includes:
SSHKit::DSL
Defined in:
lib/flotte/cli/service.rb

Instance Method Summary collapse

Instance Method Details

#hosts(service_name) ⇒ Object



14
15
16
17
18
19
# File 'lib/flotte/cli/service.rb', line 14

def hosts(service_name)
  service = Flotte.registry.services[service_name]
  Flotte.registry.roles.select { |role| role.service == service }.flat_map(&:hosts).uniq.each do |host|
    Flotte.output.puts host.name
  end
end

#listObject



7
8
9
10
11
# File 'lib/flotte/cli/service.rb', line 7

def list
  Flotte.registry.services.each do |service|
    Flotte.output.puts service.name
  end
end

#up(service_name) ⇒ Object



22
23
24
25
# File 'lib/flotte/cli/service.rb', line 22

def up(service_name)
  service = Flotte.registry.services[service_name]
  Flotte::Invocation::ServiceUp.new(service).invoke
end