- set :ident, "cluster-io"
- set :user, "ec2-user"
- set :application, "#{ident}"
- set :repository, "git://gist.github.com/1902783.git"
- set :scm, :git
- set :branch, "master"
- set :scm_verbose, true
- set :deploy_to, "/home/#{user}/app/#{application}"
- set :deploy_via, :copy
- set :git_shallow_clone, 1
- set :workers, 4
- set :node_env, 'production'
- # benchmarker
- role :web, "ec2-46-51-229-142.ap-northeast-1.compute.amazonaws.com"
- role :web, "ec2-175-41-203-216.ap-northeast-1.compute.amazonaws.com"
- role :web, "ec2-176-34-0-153.ap-northeast-1.compute.amazonaws.com"
- role :app, "ec2-176-34-0-153.ap-northeast-1.compute.amazonaws.com"
- role :web, "ec2-176-34-32-184.ap-northeast-1.compute.amazonaws.com"
- role :app, "ec2-176-34-32-184.ap-northeast-1.compute.amazonaws.com"
- role :web, "ec2-175-41-214-57.ap-northeast-1.compute.amazonaws.com"
- role :app, "ec2-175-41-214-57.ap-northeast-1.compute.amazonaws.com"
- role :web, "ec2-46-51-229-149.ap-northeast-1.compute.amazonaws.com"
- role :app, "ec2-46-51-229-149.ap-northeast-1.compute.amazonaws.com"
- namespace :deploy do
- task :start, :roles => :app do
- run "NODE_ENV=#{node_env} WORKERS=#{workers} forever start #{current_path}/cluster.js"
- end
- task :stop, :roles => :app do
- run "forever stop #{current_path}/cluster.js"
- end
- task :restart, :roles => :app, :except => { :no_release => true } do
- run "NODE_ENV=#{node_env} WORKERS=#{workers} forever restart #{current_path}/cluster.js"
- end
- end
- after "deploy:create_symlink", :roles => :app do
- run "ln -svf #{shared_path}/node_modules #{current_path}/node_modules"
- run "cd #{current_path} && npm install --mongodb:native --production"
- end
- namespace :prepare do
- task :dir do
- run "mkdir -p ~/app/#{application}/releases"
- run "mkdir -p ~/app/#{application}/shared"
- run "mkdir -p ~/app/#{application}/shared/node_modules"
- end
- task :node do
- run "#{try_sudo} yum install git openssl-devel"
- run "#{try_sudo} yum groupinstall \"Development Tools\""
- run "git clone https://github.com/isaacs/nave.git ~/.nave"
- run "#{try_sudo} ~/.nave/nave.sh usemain 0.6.11"
- end
- end