Class: Awestruct::CLI::Deploy

Inherits:
Object
  • Object
show all
Defined in:
lib/awestruct/cli/deploy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(site_config, deploy_config) ⇒ Deploy

Returns a new instance of Deploy.



12
13
14
15
16
# File 'lib/awestruct/cli/deploy.rb', line 12

def initialize(site_config, deploy_config)
  @site_config   = site_config
  @deploy_config = deploy_config
  deploy_config[:type] ||= (is_github? ? :github_pages : :rsync)
end

Instance Attribute Details

#deploy_configObject

Returns the value of attribute deploy_config.



10
11
12
# File 'lib/awestruct/cli/deploy.rb', line 10

def deploy_config
  @deploy_config
end

#site_configObject

Returns the value of attribute site_config.



9
10
11
# File 'lib/awestruct/cli/deploy.rb', line 9

def site_config
  @site_config
end

Instance Method Details

#deploy_typeObject



18
19
20
# File 'lib/awestruct/cli/deploy.rb', line 18

def deploy_type
  deploy_config[:type]
end

#runObject



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/awestruct/cli/deploy.rb', line 22

def run()
  deployer_class = Awestruct::Deployers.instance[ deploy_type ]
  
  if ( deployer_class.nil? )
    $stderr.puts "Unable to locate correct deployer for #{deploy_type}"
    return
  end
  
  deployer = deployer_class.new( site_config, deploy_config )
  deployer.run
end