Class: Mamiya::Master
- Inherits:
-
Agent
- Object
- Agent
- Mamiya::Master
show all
- Defined in:
- lib/mamiya/master.rb,
lib/mamiya/master/web.rb,
lib/mamiya/master/agent_monitor.rb,
lib/mamiya/master/package_status.rb,
lib/mamiya/master/application_status.rb,
lib/mamiya/master/agent_monitor_handlers.rb
Defined Under Namespace
Modules: AgentMonitorHandlers
Classes: AgentMonitor, AppBridge, ApplicationStatus, PackageStatus, Web
Constant Summary
collapse
- MASTER_EVENTS =
[]
Instance Attribute Summary collapse
Attributes inherited from Agent
#config, #logger, #serf
Instance Method Summary
collapse
Methods inherited from Agent
#currents, #existing_packages, #existing_prereleases, #releases, #run!, #stop!, #task_queue, #trigger
#match?, parse_string_expr
#distribute, #order_task, #ping, #prepare, #switch
Constructor Details
#initialize ⇒ Master
Returns a new instance of Master.
9
10
11
12
13
14
15
|
# File 'lib/mamiya/master.rb', line 9
def initialize(*)
super
@agent_monitor = AgentMonitor.new(self)
@events_only ||= []
@events_only << MASTER_EVENTS
end
|
Instance Attribute Details
#agent_monitor ⇒ Object
Returns the value of attribute agent_monitor.
17
18
19
|
# File 'lib/mamiya/master.rb', line 17
def agent_monitor
@agent_monitor
end
|
Instance Method Details
#applications ⇒ Object
49
50
51
52
53
|
# File 'lib/mamiya/master.rb', line 49
def applications
config.storage_class.find(
config[:storage]
).keys
end
|
#labels ⇒ Object
59
60
61
|
# File 'lib/mamiya/master.rb', line 59
def labels
[]
end
|
#start ⇒ Object
29
30
31
32
33
34
|
# File 'lib/mamiya/master.rb', line 29
def start
web_start
serf_start
monitor_start
end
|
#status(packages: false) ⇒ Object
55
56
57
|
# File 'lib/mamiya/master.rb', line 55
def status(packages: false)
{name: serf.name, master: true}
end
|
#storage(app) ⇒ Object
41
42
43
44
45
46
47
|
# File 'lib/mamiya/master.rb', line 41
def storage(app)
config.storage_class.new(
config[:storage].merge(
application: app
)
)
end
|
#terminate ⇒ Object
36
37
38
39
|
# File 'lib/mamiya/master.rb', line 36
def terminate
@agent_monitor.stop!
super
end
|
#web ⇒ Object
19
20
21
22
23
24
25
26
27
|
# File 'lib/mamiya/master.rb', line 19
def web
logger = self.logger
this = self
@web ||= Rack::Builder.new do
use AppBridge, logger, this
run Web
end
end
|