Report abuse

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# overrides for merb
namespace :merb do

  # to start from cold boot:
  # merb --user deploy --group users --daemonize --cluster-nodes 3 --port 4000 --adapter thin --environment production

  # to stop merb:
  # merb --graceful all
  
  desc "Start Merb"
  task :start do
    # can't get the --user deploy and --group deploy to work with daemonize
    run "merb --merb-root #{current_path} --daemonize --cluster-nodes #{merb_cluster_nodes} --port #{merb_start_port} --environment production --log #{current_path}/log/merb.log"
  end
  
  desc "Stop Merb"
  task :stop do
    run "merb --merb-root #{current_path} --graceful all"  
  end  
  
  desc "Restart Merb"
  task :restart do
    merb.stop
    run "sleep 3" # to wait for merb to shut down
    merb.start
  end
  
end

namespace :deploy do

  task :start do
    merb.start  
  end

  task :restart do
    merb.restart
  end
  
  task :stop do
    merb.stop
  end
  
end