Sha256: fea1c725c73d5dd47c92911990a6ebde38aad85315c2b30b94d846aca406ff17

Contents?: true

Size: 1.23 KB

Versions: 32

Compression:

Stored size: 1.23 KB

Contents

require_relative './base_manager'
module CapistranoMulticonfigParallel
  # class used to find application dependencies
  class SingleAppManager < CapistranoMulticonfigParallel::BaseManager
    include Celluloid
    include Celluloid::Logger

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

    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

    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

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

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
capistrano_multiconfig_parallel-0.13.0 lib/capistrano_multiconfig_parallel/managers/single_app_manager.rb
capistrano_multiconfig_parallel-0.12.9 lib/capistrano_multiconfig_parallel/managers/single_app_manager.rb
capistrano_multiconfig_parallel-0.12.8 lib/capistrano_multiconfig_parallel/managers/single_app_manager.rb
capistrano_multiconfig_parallel-0.12.7 lib/capistrano_multiconfig_parallel/managers/single_app_manager.rb
capistrano_multiconfig_parallel-0.12.6 lib/capistrano_multiconfig_parallel/helpers/single_app_manager.rb
capistrano_multiconfig_parallel-0.12.5 lib/capistrano_multiconfig_parallel/helpers/single_app_manager.rb
capistrano_multiconfig_parallel-0.12.3 lib/capistrano_multiconfig_parallel/helpers/single_app_manager.rb
capistrano_multiconfig_parallel-0.12.2 lib/capistrano_multiconfig_parallel/helpers/single_app_manager.rb
capistrano_multiconfig_parallel-0.12.1 lib/capistrano_multiconfig_parallel/helpers/single_app_manager.rb
capistrano_multiconfig_parallel-0.12.0 lib/capistrano_multiconfig_parallel/helpers/single_app_manager.rb
capistrano_multiconfig_parallel-0.11.6 lib/capistrano_multiconfig_parallel/helpers/single_app_manager.rb
capistrano_multiconfig_parallel-0.11.5 lib/capistrano_multiconfig_parallel/helpers/single_app_manager.rb
capistrano_multiconfig_parallel-0.11.4 lib/capistrano_multiconfig_parallel/helpers/single_app_manager.rb
capistrano_multiconfig_parallel-0.11.3 lib/capistrano_multiconfig_parallel/helpers/single_app_manager.rb
capistrano_multiconfig_parallel-0.11.2 lib/capistrano_multiconfig_parallel/helpers/single_app_manager.rb
capistrano_multiconfig_parallel-0.11.1 lib/capistrano_multiconfig_parallel/helpers/single_app_manager.rb
capistrano_multiconfig_parallel-0.11.0 lib/capistrano_multiconfig_parallel/helpers/single_app_manager.rb
capistrano_multiconfig_parallel-0.10.0 lib/capistrano_multiconfig_parallel/helpers/single_app_manager.rb
capistrano_multiconfig_parallel-0.9.2 lib/capistrano_multiconfig_parallel/helpers/single_app_manager.rb
capistrano_multiconfig_parallel-0.9.1 lib/capistrano_multiconfig_parallel/helpers/single_app_manager.rb