Erik Zaadi

The tales of a developer with passion for dad jokes

s3cmd is dead, long live s3-cli

For those of you that still use Octopress like me, one of the annoying things is deploying to Amazon S3.

I was using s3cmd which is indeed an awesome utility to sync the rendered blog to S3, however it’s slow, it’ll take about 5 minutes to deploy my blog, which is not a huge blog.

While implementing a quick hack that uploads images to Amazon S3, I stumbeled upon a certain Mr Awesome called Andrew Kelley - @andrewrk, who’s node s3 client I used.

In the README for the node-s3-client there was a link to s3-cli.

This is a inplace replace to s3cmd, written in node (yaay!), which works flawlessly with the existing s3cmd configuration, which (amongs other awsome stuff), uploads to S3 in parallel, saving LOADS of time.

I did a quick change to the Octopress Rakefile

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
diff --git a/Rakefile b/Rakefile
index fccdd5e..47f3e09 100755
--- a/Rakefile
+++ b/Rakefile
@@ -403,10 +403,10 @@ task :list do
   puts "(type rake -T for more detail)\n\n"
 end
 
-desc "Deploy with s3cmd"
+desc "Deploy with s3-cli"
 task :s3 do
     puts "S3 FTW"
     cd "#{public_dir}" do
-        system "s3cmd sync --delete-removed . s3://yourbucket.com/"
+        system "s3-cli sync --delete-removed . s3://yourbucket.com/"
     end
 end

And Voila! Deploy time reduced from 5 minutes to 17 seconds (UBER W000TZ!!1)

Stay classy San Diego.

Share on: