Class: CapistranoMulticonfigParallel::SingleAppManager

Inherits:
BaseManager
  • Object
show all
Includes:
Celluloid, Celluloid::Logger
Defined in:
lib/capistrano_multiconfig_parallel/helpers/single_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, #original_argv, #stage

Instance Method Summary collapse

Methods inherited from BaseManager

#can_start?, #can_tag_staging?, #check_before_starting, #check_giflow_tasks, #check_multi_stages, #collect_jobs, #configuration, #confirmation_applies_to_all_workers?, #custom_command?, #custom_commands, #deploy_app, #executes_deploy_stages?, #fetch_multi_stages, #get_app_additional_env_options, #initialize, #initialize_data, #multi_apps?, #process_jobs, #start, #tag_staging_exists?, #verify_options_custom_command, #wants_deploy_production?, #worker_environments

Constructor Details

This class inherits a constructor from CapistranoMulticonfigParallel::BaseManager

Instance Method Details

#deploy_single_app(options) ⇒ Object



41
42
43
44
45
46
# File 'lib/capistrano_multiconfig_parallel/helpers/single_app_manager.rb', line 41

def deploy_single_app(options)
  return if custom_command?
  collect_jobs(options) do |new_options|
    deploy_app(new_options)
  end
end

#runObject



8
9
10
11
12
13
14
15
16
# File 'lib/capistrano_multiconfig_parallel/helpers/single_app_manager.rb', line 8

def run
  options = {}
  if custom_command?
    run_custom_command(options)
  else
    deploy_single_app(options)
  end
  process_jobs
end

#run_custom_command(options) ⇒ Object



18
19
20
21
22
23
24
25
26
27
# File 'lib/capistrano_multiconfig_parallel/helpers/single_app_manager.rb', line 18

def run_custom_command(options)
  return unless custom_command?
  options = verify_options_custom_command(options)
  action_name = @name
  if action_name == custom_commands[:stages]
    stage_deploy(options)
  else
    raise "Custom command #{@name} not available for single apps"
  end
end

#stage_deploy(options) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
# File 'lib/capistrano_multiconfig_parallel/helpers/single_app_manager.rb', line 29

def stage_deploy(options)
  return unless custom_command?
  stages = fetch_multi_stages
  return if stages.blank?
  stages = check_multi_stages(stages)
  collect_jobs(options) do |new_options|
    stages.each do |stage|
      deploy_app(new_options.merge('stage' => stage))
    end
  end
end