05.07.2013
by Esa Turtiainen
tags: S3 git AWS

Deploy your web server from the local machine to S3:

s3cmd sync --exclude '.git\*' --exclude '\*~' ./ s3://www.\`basename $PWD\`

I put my web server into ~/git/domain.com. You cd to this directory. This one-liner sends all important files from the current directory to the S3 web server in bucket www.domain.com. Directory .git is ignored and all emacs backup files ending with ~.

This one-liner works with any directory that follows the same convention. It works as well with privu.net and alayrita.com.

And it is sync. It sends only changed files and it can be used always when you make a modification.