Streams of thought by...

This is the (tumble) log by Innerfusion, I'll post various things about code, design, politics, or whatever is interesting at the moment.

10/19/2010
1:29pm
Go back home
Comments (View)

Quick Deployment with Rsync and Ruby

UPDATE, this is now a gem!

As I’ve mentioned before, I’m a huge fan of using rsync for deployment. When working on smaller sites and projects, I find that the other deployment method that I use; capistrano, is a bit of overkill, I rarely, if ever need to rollback revisions or share assets across deployments on simple websites. Since I use git, I can rollback revisions and ignore certain files using .gitignore. With that said, I think that I’ve come up with the most simple and perfect way to deploy small projects. This assumes that you use the following:

  • OSX or any *nix variety OS (haven’t tested it on ubuntu, but I assume this’ll work the same)
  • rsync / ssh
  • git
  • and of course ruby
  • textmate or any other editor that accepts textmate’s bundle snippet system
  1. Add the following snippet to your bundles:
  1. Assign the word deploy for the snippet expansion.
  2. Add a file called deploy.rb to the root of your project, make sure and chmod 755 it.
  3. Type deploy and expand the snippet and fill in your deployment details.
  4. Once you are ready, just run ./deploy.rb in the terminal.

The great thing about this is that you ignore files on deployment simply by using .gitignore and rollback using git. Why attempt to re-do those things when git does such a good job of it itself? Enjoy!

Posted in: rsync ruby deployment git

Notes

  1. innerfusion posted this