capistrano_node_recipes

Capistrano recipe for deploying node.js apps.

Features

Usage

First install the gem:

sudo gem install capistrano-node-deploy

or add it to your Gemfile if you have one:

gem "capistrano-node-deploy"

Now add the following to your Capfile

require "capistrano/node-deploy"

Full Capfile Example

require "capistrano/node-deploy"

set :application, "my-node-app-name"
set :repository,  "git@github.com:/loopj/my-node-app-name"
set :user, "deploy"
set :scm, :git
set :deploy_to, "/var/apps/my-app-folder"

role :app, "myserver.com"

Overriding Default Settings

# Set app command to run (defaults to index.js, or your `main` file from `package.json`)
set :app_command, "my_server.coffee"

# Set additional environment variables for the app
set :app_environment, "PORT=8080"

# Set node binary to run (defaults to /usr/bin/node)
set :node_binary, "/usr/bin/coffee"
    
# Set node environment (defaults to production)
set :node_env, "staging"
    
# Set the user to run node as (defaults to deploy)
set :node_user, "james"

# Set the name of the upstart command (defaults to #{application}-#{node_env})
set :upstart_job_name, "myserver"

Contributing to capistrano-node-deploy

Copyright © 2012 James Smith. See LICENSE.txt for further details.