brightbox 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -31,12 +31,35 @@ namespace :deploy do
31
31
  end
32
32
  depend :remote, :command, monit_command
33
33
 
34
- #Override start, stop and restart so that they use Monit to restart the
34
+ def mongrel_cluster_command(event)
35
+ "#{mongrel_command} cluster::#{event} -C #{mongrel_config_file}" <<
36
+ if event == "status"
37
+ ""
38
+ else
39
+ " --clean"
40
+ end
41
+ end
42
+
43
+ def monitor_cluster_command(event)
44
+ case event
45
+ when "start","restart"
46
+ "#{monit_command} -g #{application} monitor all"
47
+ when "stop"
48
+ "#{monit_command} -g #{application} unmonitor all"
49
+ else
50
+ nil
51
+ end
52
+ end
53
+
54
+ #Override start, stop and restart so that they use mongrel to restart the
35
55
  #application servers
36
- %W(start stop restart status).each do |event|
56
+ %w(start stop restart status).each do |event|
37
57
  desc "Ask mongrel to #{event} your application."
38
58
  task event, :roles => :app, :except => {:no_release => true } do
39
- try_sudo "#{mongrel_command} cluster::#{event} -C #{mongrel_config_file} --clean"
59
+ try_sudo mongrel_cluster_command(event)
60
+ if cmd = monitor_cluster_command(event)
61
+ sudo cmd
62
+ end
40
63
  end
41
64
  end
42
65
 
@@ -23,7 +23,7 @@ def rake_task(taskname)
23
23
  rake_env = fetch(:rake_env, "")
24
24
  directory = current_release
25
25
 
26
- "cd #{directory}; #{rake} RAILS_ENV=#{rails_env} #{rake_env} #{taskname}"
26
+ %Q{sh -c 'cd #{directory}; #{rake} RAILS_ENV=#{rails_env} #{rake_env} #{taskname}'}
27
27
  end
28
28
 
29
29
  def on_one_line(cmd_list)
@@ -1,3 +1,3 @@
1
1
  module Brightbox
2
- VERSION = "2.0.1"
2
+ VERSION = "2.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brightbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Leach
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2008-06-10 00:00:00 +01:00
13
+ date: 2008-06-12 00:00:00 +01:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency