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/21/2010
12:23am
Comments (View)

Introducing Bam : A simple deployment utility

As a thought about the post that I wrote the other day. I figured why not just turn it into a gem? This would be a good excuse for me to write my first command line gem and also learn all the intricacies involved with it. So without further ado, here it is: bam the easiest, most fastest way to deploy your project! It’s super simple to get going and use too!

Installation

  gem install bam # => you might need sudo here

Usage

  cd into/your/project/root
  bamify
  # it should generate a deploy.bam file, go ahead and open it up and update it
  # do some work on your project
  bam

That’s it! No DSL to learn, a minimal amount of ceremony involved with setting it up, and best of all, the deploy file just involves setting 2 variables at the minimum. Now you to can deploy your recipes, er, I mean your site or project the Emeril Lagasse style with BAM! There’s also some variables to allow you to do some pre deployment tasks and post deployment tasks that are limited to running commands locally, but most of the time I don’t need them and honestly if it gets more complicated than that, just do yourself a favor and use capistrano.

Ok enough talk, show me already!

Alright here’s a basic demo of how it works:

Get the source at http://github.com/vanntastic/bam if you want to fork it. Here’s a quick video of Emeril reminding you how fast and simple your deployments can be:

Posted in: ruby gems deployment rsync bam
10/19/2010
1:29pm
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
9/9/2009
10:51am
Comments (View)

Running rsync with sudo

Rsync can probably be the best deployment tool (among other things) to use if you consider how fast and efficient it is. Lately however, I’ve run into issues on needing to rsync into directories that required sudo privileges, luckily google gave me a bit of help when figuring out how to do it.

Here is a version that simply sends sudo to the server and prepends rsync with sudo:

# run rsync with sudo
stty -echo; ssh you@hostname 'sudo -v'; stty echo
rsync -avz --rsync-path='sudo rsync' ~/location/on/your/computer you@hostname:~/location/on/server

You’ll obviously want to replace you@hostname and the location paths.

Fork the gist

Posted in: snippets rsync linux deployment