Class: CapistranoMulticonfigParallel::MultiAppManager
- Inherits:
-
BaseManager
- Object
- BaseManager
- CapistranoMulticonfigParallel::MultiAppManager
- Includes:
- Celluloid, Celluloid::Logger
- Defined in:
- lib/capistrano_multiconfig_parallel/helpers/multi_app_manager.rb
Overview
class used to find application dependencies
Instance Attribute Summary
Attributes inherited from BaseManager
#application, #args, #argv, #condition, #default_stage, #deps, #job_registered_condition, #jobs, #manager, #name, #stage
Instance Method Summary collapse
-
#initialize(cap_app, top_level_tasks, stages) ⇒ MultiAppManager
constructor
A new instance of MultiAppManager.
- #menu_deploy_interactive(options) ⇒ Object
- #multi_stage_deploy(options) ⇒ Object
- #run ⇒ Object
- #run_custom_command(options) ⇒ Object
Methods inherited from BaseManager
#can_start?, #collect_jobs, #custom_command?, #custom_commands, #deploy_app, #fetch_multi_stages, #multi_apps?, #process_jobs, #start
Constructor Details
#initialize(cap_app, top_level_tasks, stages) ⇒ MultiAppManager
Returns a new instance of MultiAppManager.
9 10 11 12 |
# File 'lib/capistrano_multiconfig_parallel/helpers/multi_app_manager.rb', line 9 def initialize(cap_app, top_level_tasks, stages) super(cap_app, top_level_tasks, stages) @dependency_tracker = CapistranoMulticonfigParallel::DependencyTracker.new(Actor.current) end |
Instance Method Details
#menu_deploy_interactive(options) ⇒ Object
50 51 52 53 54 55 |
# File 'lib/capistrano_multiconfig_parallel/helpers/multi_app_manager.rb', line 50 def () multi_collect_and_run_jobs() do |apps, | deploy_multiple_apps(apps, ) deploy_app() if !custom_command? && ['app'].present? end end |
#multi_stage_deploy(options) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/capistrano_multiconfig_parallel/helpers/multi_app_manager.rb', line 38 def multi_stage_deploy() stages = fetch_multi_stages return if stages.blank? multi_collect_and_run_jobs() do |apps, | apps.each do |app| stages.each do |stage| deploy_app(.merge('app' => app, 'stage' => stage)) end end if apps.present? end end |
#run ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/capistrano_multiconfig_parallel/helpers/multi_app_manager.rb', line 14 def run = {} if custom_command? run_custom_command() else () end process_jobs end |
#run_custom_command(options) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/capistrano_multiconfig_parallel/helpers/multi_app_manager.rb', line 24 def run_custom_command() return unless custom_command? CapistranoMulticonfigParallel. = true [:action] = @argv['ACTION'].present? ? @argv['ACTION'].present? : 'deploy' action_name = @name if action_name == custom_commands[:menu] () elsif action_name == custom_commands[:stages] multi_stage_deploy() else raise "Custom command #{@name} not available for multi apps" end end |