Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- load 'deploy'
- set :application, "analytics"
- set :repository, "gitosis@192.168.0.63:analytics.git"
- set :deploy_via, :remote_cache
- set :deploy_to, "/u/apps/#{application}"
- set :scm, :git
- set :user, "app"
- set :use_sudo, false
- set :node_port, 7777
- set :node_pid, "#{shared_path}/pids/node-#{node_port}.pid"
- set :node_log, "#{shared_path}/log/node-#{node_port}.log"
- set :node_socket, "#{shared_path}/sockets/node"
- set :node_session, "#{shared_path}"
- server "sleepy", :web, :app
- after "deploy:setup", "app:setup_sockets"
- namespace :app do
- task :setup_sockets, :roles => [:app] do
- run "mkdir #{shared_path}/sockets"
- end
- task :attach do
- run "dtach -a #{node_socket}"
- end
- end
- namespace :deploy do
- task :start do
- node_cmd = "node #{current_path}/app.js --port #{node_port} --pid #{node_pid} > #{node_log}"
- run "cd #{current_path} && dtach -n #{node_socket} #{node_cmd}"
- end
- task :stop do
- run "kill `cat #{node_pid}` && rm #{node_pid}"
- end
- end
Add Comment
Please, Sign In to add comment