Skip to content

Instantly share code, notes, and snippets.

@brianjriddle
Created February 16, 2013 12:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianjriddle/4966839 to your computer and use it in GitHub Desktop.
Save brianjriddle/4966839 to your computer and use it in GitHub Desktop.
Rakefile used to deploy a jekyll site to s3
require 'rake/clean'
require 'jekyll'
require 'jekyll/site'
#remove the site dir.
CLEAN.include('_site')
desc "generate the site. keeping it simple."
task :generate do
options = Jekyll.configuration({})
site = Jekyll::Site.new(options)
site.process
end
desc"deploys to brianjriddle.riddle.se"
task :deploy => [:has_s3cmd, :clean, :generate] do
puts %Q{s3cmd sync --acl-public _site/ s3://brianjriddle.riddle.se/}
puts %x{s3cmd sync --acl-public _site/ s3://brianjriddle.riddle.se/}
end
task :has_s3cmd do
has_s3cmd = false
ENV["PATH"].split(':').each do |path|
begin
if File.exists?(path + "/s3cmd")
has_s3cmd = true
end
rescue
puts $!
end
end
raise 's3cmd not found in path' unless has_s3cmd
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment