Skip to content

Instantly share code, notes, and snippets.

@glidenote
Created August 29, 2012 09:52
Show Gist options
  • Save glidenote/3509434 to your computer and use it in GitHub Desktop.
Save glidenote/3509434 to your computer and use it in GitHub Desktop.
octopress for s3
diff --git a/Rakefile b/Rakefile
index 3d2b385..183ee17 100644
--- a/Rakefile
+++ b/Rakefile
@@ -355,3 +355,16 @@ task :list do
puts "Tasks: #{(Rake::Task.tasks - [Rake::Task[:list]]).join(', ')}"
puts "(type rake -T for more detail)\n\n"
end
+
+s3_bucket = "blog.glidenote.com"
+s3_delete = ""
+
+desc "Deploy website to s3"
+task :s3 do
+ exclude = ""
+ if File.exists?('./s3-exclude')
+ exclude = "--exclude-from '#{File.expand_path('./s3-exclude')}'"
+ end
+ puts "## Deploying website via s3cmd"
+ ok_failed system("s3cmd sync --guess-mime-type --acl-public #{exclude} #{"--delete-removed" unless s3_delete == false} #{public_dir}/ s3://#{s3_bucket}/")
+end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment