nesquena-cap-recipes 0.3.5 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.textile CHANGED
@@ -7,11 +7,12 @@ Feel free to contribute to this and make it better!
7
7
 
8
8
  Currently included:
9
9
 
10
- * Phusion Passenger (Setup and Deployment)
11
10
  * Apache Server
12
- * Memcache Process
11
+ * Phusion Passenger (Setup and Deployment)
12
+ * Memcache Process (Setup and Deployment)
13
13
  * Juggernaut Daemon
14
14
  * Backgroundrb Server
15
+ * DelayedJob Worker
15
16
 
16
17
  h2. INSTALLATION
17
18
 
@@ -28,7 +29,7 @@ Include into your deploy.rb configuration file for Capistrano:
28
29
  # use a single slice of the deployment process
29
30
  # (use hooks which tie all the recipes into the deployment process,
30
31
  # tasks for managing and tasks for installing):
31
- # substitude memcache with: passenger, rails, apache, backgroundrb, juggernaut
32
+ # substitute memcache with: passenger, rails, apache, backgroundrb, delayed_job, juggernaut
32
33
  require 'cap_recipes/tasks/memcache'
33
34
 
34
35
  # OR
@@ -40,11 +41,13 @@ Include into your deploy.rb configuration file for Capistrano:
40
41
  require 'cap_recipes/tasks/memcache/install'
41
42
  </code>
42
43
  </pre>
43
-
44
+
44
45
  h2. USAGE
45
46
 
46
47
  h3. Apache
47
48
 
49
+ These recipes manage the apache web server
50
+
48
51
  h4. Configuration
49
52
 
50
53
  * apache_init_path - the path to the init.d apache file [default: '/etc/init.d/apache2']
@@ -65,6 +68,8 @@ h5. install.rb
65
68
 
66
69
  h3. Passenger
67
70
 
71
+ These recipes manage the passenger module for apache
72
+
68
73
  h4. Configuration
69
74
 
70
75
  * base_ruby_path - the base path to the ruby installation [default: "/usr"]
@@ -92,6 +97,8 @@ h5. install.rb
92
97
 
93
98
  h3. Rails
94
99
 
100
+ These recipes support rails-specific functionality
101
+
95
102
  h4. Tasks
96
103
 
97
104
  h5. manage.rb
@@ -111,9 +118,35 @@ h5. hooks.rb
111
118
  after "deploy:update_code", "rails:sweep:cache" # clear cache after updating code
112
119
  after "deploy:restart" , "rails:repair_permissions" # fix the permissions to work properly
113
120
  after "deploy:restart" , "rails:ping" # ping passenger to start the rails instance
114
-
121
+
122
+ h3. DelayedJob
123
+
124
+ These recipes are for tobi's delayed_job plugin for background job queue processing
125
+
126
+ h4. Configuration
127
+
128
+ * delayed_script_path - the path to the delayed job script [default: 'script/delayed_job']
129
+ * delayed_job_env - the rails environment [default: 'production']
130
+
131
+ h4. Tasks
132
+
133
+ h5. manage.rb
134
+
135
+ delayed_job
136
+ :stop
137
+ :start
138
+ :restart
139
+
140
+ h5. hooks.rb
141
+
142
+ after "deploy:start", "delayed_job:start"
143
+ after "deploy:stop", "delayed_job:stop"
144
+ after "deploy:restart", "delayed_job:restart"
145
+
115
146
  h3. Backgroundrb
116
147
 
148
+ These recipes are for backgroundrb job queue processing
149
+
117
150
  h4. Configuration
118
151
 
119
152
  * backgroundrb_log - the path to the backgroundrb log file
@@ -139,6 +172,8 @@ h5. hooks.rb
139
172
 
140
173
  h3. Juggernaut
141
174
 
175
+ These recipes are for managing the juggernaut push server
176
+
142
177
  h4. Configuration
143
178
 
144
179
  * juggernaut_config - path to juggernaut config file [default: "#{current_path}/config/juggernaut.yml"]
@@ -163,6 +198,8 @@ h5. hooks.rb
163
198
 
164
199
  h3. Memcache
165
200
 
201
+ These recipes are for managing the memcached caching mechanism
202
+
166
203
  h4. Configuration
167
204
 
168
205
  * memcache_init_path - path to memcache config file [default: "/etc/init.d/memcache"]
@@ -210,23 +247,31 @@ set :repository, "git@repos.site.com:/home/git/repos.git"
210
247
 
211
248
  # Note this happens after the general settings have been defined
212
249
  require 'rubygems'
213
- require 'cap_recipes'
214
250
 
215
251
  # PASSENGER
252
+ require 'cap_recipes/tasks/passenger'
216
253
  set :base_ruby_path, '/opt/ruby-enterprise' # defaults to "/usr"
217
254
  set :apache_init_path, '/etc/init.d/apache2' # defaults to "/etc/init.d/apache2"
218
255
 
219
256
  # BACKGROUNDRB
257
+ require 'cap_recipes/tasks/backgroundrb'
220
258
  set :backgroundrb_log, "/var/log/backgroundrb.log" # defaults to "#{release_path}/log/backgroundrb.log"
221
259
  set :backgroundrb_host, "worker.site.com" # defaults to localhost
222
260
  set :backgroundrb_env, "staging" # defaults to production
223
261
 
262
+ # DELAYED_JOB
263
+ require 'cap_recipes/tasks/delayed_job'
264
+ set :delayed_script_path, 'script/djworker' # defaults to 'script/delayed_job'
265
+ set :delayed_job_env, 'staging' # defaults to production
266
+
224
267
  # JUGGERNAUT
268
+ require 'cap_recipes/tasks/juggernaut'
225
269
  set :juggernaut_config, "/some/path/juggernaut.yml" # defaults to "#{current_path}/config/juggernaut.yml"
226
270
  set :juggernaut_pid, "/some/path/juggernaut.pid" # defaults to "#{current_path}/tmp/pids/juggernaut.pid"
227
271
  set :juggernaut_log, "/var/log/juggernaut.log" # defaults to #{release_path}/log/juggernaut.log
228
272
 
229
273
  # MEMCACHE
274
+ require 'cap_recipes/tasks/memcache'
230
275
  set :memcache_init_path, "/etc/init.d/memcache" # defaults to "/etc/init.d/memcache"
231
276
  </code>
232
277
  </pre>
data/Rakefile ADDED
@@ -0,0 +1,45 @@
1
+ # rake version:bump:patch && rake release && rake build && rake install && sudo gem cleanup
2
+ require 'rake'
3
+ require 'rake/testtask'
4
+ require 'rake/rdoctask'
5
+
6
+ begin
7
+ require 'jeweler'
8
+ Jeweler::Tasks.new do |s|
9
+ s.name = "cap-recipes"
10
+ s.summary = %Q{Battle-tested capistrano recipes for passenger, apache, and more}
11
+ s.email = "nesquena@gmail.com"
12
+ s.homepage = "http://github.com/nesquena/cap-recipes"
13
+ s.description = "Battle-tested capistrano recipes for passenger, apache, and more"
14
+ s.authors = ["Nathan Esquenazi"]
15
+ end
16
+ rescue LoadError
17
+ puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
18
+ end
19
+
20
+ Rake::RDocTask.new do |rdoc|
21
+ rdoc.rdoc_dir = 'rdoc'
22
+ rdoc.title = 'cap-recipes'
23
+ rdoc.options << '--line-numbers' << '--inline-source'
24
+ rdoc.rdoc_files.include('README*')
25
+ rdoc.rdoc_files.include('lib/**/*.rb')
26
+ end
27
+
28
+ begin
29
+ require 'rcov/rcovtask'
30
+ Rcov::RcovTask.new do |t|
31
+ t.libs << 'test'
32
+ t.test_files = FileList['test/**/*_test.rb']
33
+ t.verbose = true
34
+ end
35
+ rescue LoadError
36
+ end
37
+
38
+ desc "Run all specs in spec directory"
39
+ task :spec do |t|
40
+ options = "--colour --format progress --loadby --reverse"
41
+ files = FileList['spec/**/*_spec.rb']
42
+ system("spec #{options} #{files}")
43
+ end
44
+
45
+ task :default => :spec
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
+ :patch: 7
2
3
  :major: 0
3
4
  :minor: 3
4
- :patch: 5
@@ -0,0 +1,5 @@
1
+ Capistrano::Configuration.instance(true).load do
2
+ after "deploy:start", "delayed_job:start"
3
+ after "deploy:stop", "delayed_job:stop"
4
+ after "deploy:restart", "delayed_job:restart"
5
+ end
@@ -0,0 +1,21 @@
1
+ Capistrano::Configuration.instance(true).load do
2
+ set :delayed_script_path, 'script/delayed_job'
3
+ set :delayed_job_env, 'production'
4
+
5
+ namespace :delayed_job do
6
+ desc "Start delayed_job process"
7
+ task :start, :roles => :app do
8
+ run "cd #{current_path} && #{sudo} ruby #{delayed_script_path} start #{delayed_job_env}"
9
+ end
10
+
11
+ desc "Stop delayed_job process"
12
+ task :stop, :roles => :app do
13
+ run "cd #{current_path} && #{sudo} ruby #{delayed_script_path} stop #{delayed_job_env}"
14
+ end
15
+
16
+ desc "Restart delayed_job process"
17
+ task :restart, :roles => :app do
18
+ run "cd #{current_path} && #{sudo} ruby #{delayed_script_path} restart #{delayed_job_env}"
19
+ end
20
+ end
21
+ end
@@ -0,0 +1 @@
1
+ Dir[File.join(File.dirname(__FILE__), 'delayed_job/*.rb')].sort.each { |lib| require lib }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nesquena-cap-recipes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Esquenazi
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-03-15 00:00:00 -07:00
12
+ date: 2009-04-18 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -20,52 +20,45 @@ executables: []
20
20
  extensions: []
21
21
 
22
22
  extra_rdoc_files:
23
- - README.textile
24
23
  - LICENSE
24
+ - README.textile
25
25
  files:
26
+ - LICENSE
26
27
  - README.textile
28
+ - Rakefile
27
29
  - VERSION.yml
28
- - lib/cap_recipes
29
- - lib/cap_recipes/tasks
30
- - lib/cap_recipes/tasks/apache
30
+ - lib/cap_recipes.rb
31
+ - lib/cap_recipes/tasks/apache.rb
31
32
  - lib/cap_recipes/tasks/apache/install.rb
32
33
  - lib/cap_recipes/tasks/apache/manage.rb
33
- - lib/cap_recipes/tasks/apache.rb
34
- - lib/cap_recipes/tasks/backgroundrb
34
+ - lib/cap_recipes/tasks/backgroundrb.rb
35
35
  - lib/cap_recipes/tasks/backgroundrb/hooks.rb
36
36
  - lib/cap_recipes/tasks/backgroundrb/manage.rb
37
- - lib/cap_recipes/tasks/backgroundrb.rb
38
- - lib/cap_recipes/tasks/juggernaut
37
+ - lib/cap_recipes/tasks/delayed_job.rb
38
+ - lib/cap_recipes/tasks/delayed_job/hooks.rb
39
+ - lib/cap_recipes/tasks/delayed_job/manage.rb
40
+ - lib/cap_recipes/tasks/juggernaut.rb
39
41
  - lib/cap_recipes/tasks/juggernaut/hooks.rb
40
42
  - lib/cap_recipes/tasks/juggernaut/manage.rb
41
- - lib/cap_recipes/tasks/juggernaut.rb
42
- - lib/cap_recipes/tasks/memcache
43
+ - lib/cap_recipes/tasks/memcache.rb
43
44
  - lib/cap_recipes/tasks/memcache/hooks.rb
44
45
  - lib/cap_recipes/tasks/memcache/install.rb
45
46
  - lib/cap_recipes/tasks/memcache/manage.rb
46
- - lib/cap_recipes/tasks/memcache.rb
47
- - lib/cap_recipes/tasks/passenger
47
+ - lib/cap_recipes/tasks/passenger.rb
48
48
  - lib/cap_recipes/tasks/passenger/install.rb
49
49
  - lib/cap_recipes/tasks/passenger/manage.rb
50
- - lib/cap_recipes/tasks/passenger.rb
51
- - lib/cap_recipes/tasks/rails
50
+ - lib/cap_recipes/tasks/rails.rb
52
51
  - lib/cap_recipes/tasks/rails/hooks.rb
53
52
  - lib/cap_recipes/tasks/rails/manage.rb
54
- - lib/cap_recipes/tasks/rails.rb
55
53
  - lib/cap_recipes/tasks/with_scope.rb
56
- - lib/cap_recipes.rb
57
- - spec/cap
58
- - spec/cap/all
59
54
  - spec/cap/all/Capfile
60
55
  - spec/cap/helper.rb
61
56
  - spec/cap_recipes_spec.rb
62
57
  - spec/spec_helper.rb
63
- - LICENSE
64
58
  has_rdoc: true
65
59
  homepage: http://github.com/nesquena/cap-recipes
66
60
  post_install_message:
67
61
  rdoc_options:
68
- - --inline-source
69
62
  - --charset=UTF-8
70
63
  require_paths:
71
64
  - lib
@@ -86,7 +79,9 @@ requirements: []
86
79
  rubyforge_project:
87
80
  rubygems_version: 1.2.0
88
81
  signing_key:
89
- specification_version: 2
82
+ specification_version: 3
90
83
  summary: Battle-tested capistrano recipes for passenger, apache, and more
91
- test_files: []
92
-
84
+ test_files:
85
+ - spec/cap/helper.rb
86
+ - spec/cap_recipes_spec.rb
87
+ - spec/spec_helper.rb