Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: aa2d7e7b68
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 18 lines (16 sloc) 0.58 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
require 'nanoc3/tasks'

namespace 'deploy' do
  desc "Upload the compiled site to Amazon S3"
  task "s3" do
    require 'fileutils'
    Dir.chdir(File.dirname(__FILE__)) do
      site = Nanoc3::Site.new('.')
      output_dir = File.expand_path(File.join(File.dirname(__FILE__), site.config[:output_dir]))
      Dir[File.join(output_dir, '*')].each do |subdir|
        puts "rm -rf #{FileUtils.rm_rf(subdir)}"
      end
      sh 'nanoc compile'
      sh "s3cmd #{site.config[:deploy_s3][:options].join(' ')} sync #{output_dir}/* #{site.config[:deploy_s3][:dst]}"
    end
  end
end
Something went wrong with that request. Please try again.