Skip to content

Instantly share code, notes, and snippets.

@zchee
Last active August 29, 2015 14:05
Show Gist options
  • Save zchee/e89a20116351d24c4bd5 to your computer and use it in GitHub Desktop.
Save zchee/e89a20116351d24c4bd5 to your computer and use it in GitHub Desktop.
Octopress with S3 Rakefile sample
# http://blog.ieknir.com/blog/octopress-with-s3/
deploy_default = "s3"
## -- S3 Deploy config -- ##
s3_bucket = "daisukekobayashi.com"
s3_cache_secs = "3600"
s3_delete = true
desc "Deploy website via s3cmd"
task :s3 do
puts "## Deploying website via s3cmd"
ok_failed system("s3cmd sync --acl-public #{"--delete-removed" unless s3_delete == false} --reduced-redundancy --cf-invalidate public/* --add-header \"Cache-Control: max-age=#{s3_cache_secs}\" s3://#{s3_bucket}/ ")
end
# Use aws-cli
desc "Deploy website via awscli"
task :s3 do
puts "## Deploying website via awscli"
ok_failed system("aws s3 sync --profile octopress --acl public-read #{"--delete" unless s3_delete == false} public s3://#{s3_bucket}/")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment