Sha256: df1a45f19300b3e67f9553b175c5cf81e6b1c0b318d7f99c4d2b008524ec7902

Contents?: true

Size: 1.64 KB

Versions: 64

Compression:

Stored size: 1.64 KB

Contents

require 'docman/builders/builder'
require 'docman/builders/dir_builder'
require 'docman/builders/git_direct_builder'
require 'docman/builders/git_strip_builder'
require 'docman/builders/drupal_drush_builder'
require 'docman/deployers/deployer'
require 'docman/deployers/git_deployer'
require 'docman/deployers/common_deployer'
require 'docman/command'
require 'docman/composite_command'
require 'docman/builders/commands/create_symlink_cmd'
require 'docman/builders/commands/execute_script_cmd'
require 'docman/builders/commands/clean_changed_cmd'
require 'docman/builders/commands/git_commit_cmd'

# TODO: make universal logging class.

module Docman
  class DocrootController

    attr_reader :docroot_dir, :docroot_config

    def initialize(docroot_dir, deploy_target_name, options = {})
      @deploy_target = Docman::Application.instance.config['deploy_targets'][deploy_target_name]
      @deploy_target_name = deploy_target_name
      Docman::Application.instance.deploy_target = @deploy_target
      docroot_config = DocrootConfig.new(docroot_dir, @deploy_target)
      @docroot_dir = docroot_dir
      @docroot_config = docroot_config
    end

    def build(state_name)
      execute(state_name)
    end

    def deploy(name, type, version)
      @docroot_config.states_dependin_on(name, version).keys.each do |state_name|
        execute(state_name, name)
      end
    end

    def execute(state, name = nil)
      #Docman::Application.instance.config.environment(state_name, @deploy_target_name)
      params = @deploy_target
      params['state'] = state
      params['name'] = name
      Docman::Deployers::Deployer.create(params, self).perform
    end

  end

end

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
docman-0.0.69 lib/docman/docroot_controller.rb
docman-0.0.68 lib/docman/docroot_controller.rb
docman-0.0.67 lib/docman/docroot_controller.rb
docman-0.0.66 lib/docman/docroot_controller.rb
docman-0.0.65 lib/docman/docroot_controller.rb
docman-0.0.64 lib/docman/docroot_controller.rb
docman-0.0.63 lib/docman/docroot_controller.rb
docman-0.0.62 lib/docman/docroot_controller.rb
docman-0.0.61 lib/docman/docroot_controller.rb
docman-0.0.60 lib/docman/docroot_controller.rb
docman-0.0.59 lib/docman/docroot_controller.rb
docman-0.0.58 lib/docman/docroot_controller.rb
docman-0.0.57 lib/docman/docroot_controller.rb
docman-0.0.56 lib/docman/docroot_controller.rb
docman-0.0.55 lib/docman/docroot_controller.rb
docman-0.0.54 lib/docman/docroot_controller.rb
docman-0.0.53 lib/docman/docroot_controller.rb
docman-0.0.52 lib/docman/docroot_controller.rb
docman-0.0.51 lib/docman/docroot_controller.rb
docman-0.0.50 lib/docman/docroot_controller.rb