standup 0.6.3 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module Standup
2
- VERSION = '0.6.3'
2
+ VERSION = '0.6.4'
3
3
 
4
4
  def self.version
5
5
  VERSION
data/scripts/passenger.rb CHANGED
@@ -7,7 +7,7 @@ Standup.script :node do
7
7
  scripts.ec2.open_port 80, 443
8
8
 
9
9
  if install_gem('passenger', params.version) || !file_exists?('/opt/nginx/sbin/nginx')
10
- install_package 'libcurl4-openssl-dev'
10
+ install_package 'libcurl4-openssl-dev libpcrecpp0'
11
11
  sudo 'passenger-install-nginx-module --auto --auto-download --prefix=/opt/nginx'
12
12
  end
13
13
 
@@ -7,4 +7,5 @@ if [ $1 = "ALL_QUEUES" ];then
7
7
  QUEUE=$1
8
8
  fi
9
9
 
10
- sudo -u www-data /usr/local/rvm/bin/rvm-shell -c "cd <%= scripts.webapp.app_path%> && RAILS_ENV=<%= scripts.webapp.params.rails_env%> QUEUE=$QUEUE VERBOSE=1 PIDFILE=tmp/pids/resque_$1_$2.pid nohup bundle exec rake environment resque:work >> log/resque_worker_$1_$2.log 2>&1 &"
10
+ <% cmd = "cd #{scripts.webapp.app_path} && RAILS_ENV=#{scripts.webapp.params.rails_env} QUEUE=$QUEUE VERBOSE=1 PIDFILE=tmp/pids/resque_$1_$2.pid nohup bundle exec rake environment resque:work >> log/resque_worker_$1_$2.log 2>&1 &" %>
11
+ <%= with_context({:user => 'www-data'}) { remote_command(cmd) } %>
@@ -0,0 +1,4 @@
1
+ #!/bin/bash
2
+ export HOME="/home/<%= scripts.ec2.params.ssh_user %>"
3
+
4
+ sudo -u www-data /bin/bash -c "cd <%= scripts.webapp.app_path%> && RAILS_ENV=<%= scripts.webapp.params.rails_env%> VERBOSE=1 PIDFILE=<%= scripts.webapp.app_path%>/tmp/pids/resque_scheduler.pid BACKGROUND=yes bundle exec rake resque:scheduler --trace >> <%= scripts.webapp.app_path%>/log/resque_scheduler.log 2>&1 &"
@@ -0,0 +1,11 @@
1
+ <%# ((scripts.webapp.params.has_key?(:resque_queues) && scripts.webapp.params.resque_queues.presence) || {"ALL_QUEUES" => 1 }).each_pair do |queue_name,num_of_workers|%>
2
+ <%#1.upto(num_of_workers) do |num|%>
3
+ check process resque_scheduler
4
+ with pidfile <%= scripts.webapp.app_path%>/tmp/pids/resque_scheduler.pid
5
+ start program = "/bin/bash -c 'cd <%= scripts.webapp.app_path%>; RAILS_ENV=<%= scripts.webapp.params.rails_env%> script/resque_scheduler'" with timeout 120 seconds
6
+ stop program = "/bin/bash -c 'cd <%= scripts.webapp.app_path%> && kill -s QUIT `cat tmp/pids/resque_scheduler.pid` && rm -f tmp/pids/resque_scheduler.pid; exit 0;'"
7
+ if totalmem is greater than 300 MB for 10 cycles then restart
8
+ group resque
9
+
10
+ <%# end %>
11
+ <%# end %>
@@ -0,0 +1,31 @@
1
+ Standup.script :node do
2
+ def run
3
+ #scripts.redis.run unless scripts.redis.installed?
4
+
5
+ path_to_resque_exec = "#{scripts.webapp.app_path}/script/resque_scheduler"
6
+ with_processed_file script_file('resque_scheduler') do |file|
7
+ upload file,
8
+ :to => path_to_resque_exec,
9
+ :sudo => true
10
+ end
11
+
12
+ sudo "chown www-data:www-data #{path_to_resque_exec}"
13
+ sudo "chmod +x #{path_to_resque_exec}"
14
+
15
+ sudo "mkdir #{scripts.webapp.app_path}/tmp/pids"
16
+ sudo "chown www-data:www-data #{scripts.webapp.app_path}/tmp/pids"
17
+ with_processed_file script_file('resque_scheduler_monit.conf') do |file|
18
+ scripts.monit.add_watch file
19
+ end
20
+
21
+ restart
22
+ end
23
+
24
+ def restart
25
+ #((scripts.webapp.params.has_key?(:resque_queues) && scripts.webapp.params.resque_queues.presence) || {"ALL_QUEUES" => 1 }).each_pair do |queue_name, num_of_workers|
26
+ # 1.upto(num_of_workers) do |num|
27
+ scripts.monit.restart_watch "resque_scheduler"
28
+ #end
29
+ #end
30
+ end
31
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: standup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.6.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,11 +11,11 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-02-16 00:00:00.000000000 Z
14
+ date: 2012-03-27 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: trollop
18
- requirement: &70321382354960 !ruby/object:Gem::Requirement
18
+ requirement: &70283747287040 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ! '>='
@@ -23,10 +23,10 @@ dependencies:
23
23
  version: '1.16'
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: *70321382354960
26
+ version_requirements: *70283747287040
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: i18n
29
- requirement: &70321382352760 !ruby/object:Gem::Requirement
29
+ requirement: &70283747286540 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
32
  - - ! '>='
@@ -34,10 +34,10 @@ dependencies:
34
34
  version: 0.5.0
35
35
  type: :runtime
36
36
  prerelease: false
37
- version_requirements: *70321382352760
37
+ version_requirements: *70283747286540
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: activesupport
40
- requirement: &70321382365540 !ruby/object:Gem::Requirement
40
+ requirement: &70283747286080 !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
43
  - - ! '>='
@@ -45,10 +45,10 @@ dependencies:
45
45
  version: '3.0'
46
46
  type: :runtime
47
47
  prerelease: false
48
- version_requirements: *70321382365540
48
+ version_requirements: *70283747286080
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: settingslogic
51
- requirement: &70321382363300 !ruby/object:Gem::Requirement
51
+ requirement: &70283747285620 !ruby/object:Gem::Requirement
52
52
  none: false
53
53
  requirements:
54
54
  - - ! '>='
@@ -56,10 +56,10 @@ dependencies:
56
56
  version: '2.0'
57
57
  type: :runtime
58
58
  prerelease: false
59
- version_requirements: *70321382363300
59
+ version_requirements: *70283747285620
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: amazon-ec2
62
- requirement: &70321382361860 !ruby/object:Gem::Requirement
62
+ requirement: &70283747285160 !ruby/object:Gem::Requirement
63
63
  none: false
64
64
  requirements:
65
65
  - - ! '>='
@@ -67,10 +67,10 @@ dependencies:
67
67
  version: '0.9'
68
68
  type: :runtime
69
69
  prerelease: false
70
- version_requirements: *70321382361860
70
+ version_requirements: *70283747285160
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: aws-s3
73
- requirement: &70321382388220 !ruby/object:Gem::Requirement
73
+ requirement: &70283747284700 !ruby/object:Gem::Requirement
74
74
  none: false
75
75
  requirements:
76
76
  - - ! '>='
@@ -78,10 +78,10 @@ dependencies:
78
78
  version: '0.5'
79
79
  type: :runtime
80
80
  prerelease: false
81
- version_requirements: *70321382388220
81
+ version_requirements: *70283747284700
82
82
  - !ruby/object:Gem::Dependency
83
83
  name: net-ssh
84
- requirement: &70321382386440 !ruby/object:Gem::Requirement
84
+ requirement: &70283747284240 !ruby/object:Gem::Requirement
85
85
  none: false
86
86
  requirements:
87
87
  - - ! '>='
@@ -89,10 +89,10 @@ dependencies:
89
89
  version: '2.0'
90
90
  type: :runtime
91
91
  prerelease: false
92
- version_requirements: *70321382386440
92
+ version_requirements: *70283747284240
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: highline
95
- requirement: &70321382382040 !ruby/object:Gem::Requirement
95
+ requirement: &70283747283780 !ruby/object:Gem::Requirement
96
96
  none: false
97
97
  requirements:
98
98
  - - ! '>='
@@ -100,7 +100,7 @@ dependencies:
100
100
  version: 1.5.2
101
101
  type: :runtime
102
102
  prerelease: false
103
- version_requirements: *70321382382040
103
+ version_requirements: *70283747283780
104
104
  description: ''
105
105
  email:
106
106
  - ilia@flamefork.ru
@@ -171,6 +171,9 @@ files:
171
171
  - scripts/resque.rb
172
172
  - scripts/resque/resque
173
173
  - scripts/resque/resque_monit.conf
174
+ - scripts/resque_scheduler.rb
175
+ - scripts/resque_scheduler/resque_scheduler
176
+ - scripts/resque_scheduler/resque_scheduler_monit.conf
174
177
  - scripts/ruby.rb
175
178
  - scripts/ruby/gemrc
176
179
  - scripts/setup.rb
@@ -196,18 +199,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
196
199
  - - ! '>='
197
200
  - !ruby/object:Gem::Version
198
201
  version: '0'
199
- segments:
200
- - 0
201
- hash: 1022148714891701191
202
202
  required_rubygems_version: !ruby/object:Gem::Requirement
203
203
  none: false
204
204
  requirements:
205
205
  - - ! '>='
206
206
  - !ruby/object:Gem::Version
207
207
  version: '0'
208
- segments:
209
- - 0
210
- hash: 1022148714891701191
211
208
  requirements: []
212
209
  rubyforge_project: standup
213
210
  rubygems_version: 1.8.11