Skip to content

Instantly share code, notes, and snippets.

@sebastiandeutsch
Created July 13, 2011 21:10
Show Gist options
  • Save sebastiandeutsch/1081344 to your computer and use it in GitHub Desktop.
Save sebastiandeutsch/1081344 to your computer and use it in GitHub Desktop.
deploy.rb for node.js
set :stages, %w(production staging)
set :default_stage, 'staging'
require 'capistrano/ext/multistage'
set :application, "imgly-tracking"
set :domain, "node.9elements.com"
set :user, "imgly-tracking"
set :repository, "[email protected]:9elements/imgly-tracking.git"
set :use_sudo, false
ssh_options[:forward_agent] = true
set :scm, :git
set :deploy_via, :remote_cache
set :git_enable_submodules, 1
role :app, domain
role :web, domain
role :db, domain, :primary => true
namespace :deploy do
task(:start, :roles => :app) {}
task(:stop, :roles => :app) {}
task(:restart, :roles => :app, :except => { :no_release => true }) {
run "cd #{current_path}; npm install; forever stopall; forever start -c coffee index.coffee"
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment