Class: Awestruct::Deploy::S3Deploy

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

Constant Summary

Constants inherited from Base

Base::UNCOMMITTED_CHANGES

Instance Method Summary collapse

Methods inherited from Base

#existing_changes, #git, #run

Constructor Details

#initialize(site_config, deploy_config) ⇒ S3Deploy

Returns a new instance of S3Deploy.



7
8
9
10
# File 'lib/awestruct/deploy/s3_deploy.rb', line 7

def initialize( site_config, deploy_config )
  @site_path = site_config.output_dir
  @bucket = deploy_config['bucket']
end

Instance Method Details

#publish_siteObject



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

def publish_site
  $LOG.info "Syncing #{@site_path} to bucket #{@bucket}" if $LOG.info?
  s3cmd = RubyS3Cmd::S3Cmd.new
  s3cmd.sync("#{@site_path}/", @bucket)
  $LOG.info "DONE" if $LOG.info?
end