grosser-cap-recipes 0.2.19 → 0.2.21
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +28 -32
- data/VERSION.yml +1 -1
- data/lib/cap_recipes/tasks/passenger/install.rb +18 -0
- data/lib/cap_recipes/tasks/rails/{tasks.rb → manage.rb} +0 -0
- data/spec/cap/all/Capfile +2 -0
- data/spec/cap/helper.rb +2 -0
- data/spec/cap_recipes_spec.rb +13 -0
- data/spec/spec_helper.rb +16 -0
- metadata +9 -5
- data/test/cap_recipes_test.rb +0 -5
- data/test/test_helper.rb +0 -10
data/README.textile
CHANGED
@@ -1,17 +1,9 @@
|
|
1
1
|
h1. cap-recipes
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
* gem sources -a http://gems.github.com/
|
6
|
-
* sudo gem install nesquena-cap-recipes
|
7
|
-
|
8
|
-
h2. DESCRIPTION
|
3
|
+
A collection of useful capistrano recipes.
|
4
|
+
Best suited for ruby projects which deploy using Phusion Passenger.
|
9
5
|
|
10
|
-
This is a collection of capistrano recipes which will grow to encompass many useful recipes.
|
11
|
-
The intended use for these recipes is for a ruby project which deploys using Phusion Passenger and caches using memcached.
|
12
|
-
In addition, recipes for the management of various daemon processes will be included as needed.
|
13
6
|
Feel free to contribute to this and make it better!
|
14
|
-
Any of the recipes can be used on their own (TODO).
|
15
7
|
|
16
8
|
Currently included:
|
17
9
|
|
@@ -20,31 +12,35 @@ Currently included:
|
|
20
12
|
* Memcache Process
|
21
13
|
* Juggernaut Daemon
|
22
14
|
* Backgroundrb Server
|
23
|
-
|
24
|
-
h2. SYNOPSIS
|
25
|
-
|
26
|
-
To include any of these into your deploy.rb configuration file for Capistrano:
|
27
|
-
|
28
|
-
require 'cap_recipes/tasks/passenger'
|
29
|
-
require 'cap_recipes/tasks/rails'
|
30
|
-
require 'cap_recipes/tasks/apache'
|
31
|
-
require 'cap_recipes/tasks/backgroundrb'
|
32
|
-
require 'cap_recipes/tasks/juggernaut'
|
33
|
-
require 'cap_recipes/tasks/memcache'
|
34
|
-
|
35
|
-
Or to include and activate all of them:
|
36
15
|
|
37
|
-
|
38
|
-
|
39
|
-
By default, these recipes will include both tasks for managing (start/stop/restart) as well as tasks for installing when available.
|
40
|
-
The recipes also include hooks which tie all the recipes into the deployment process as appropriate.
|
16
|
+
h2. INSTALLATION
|
41
17
|
|
42
|
-
|
18
|
+
sudo gem install nesquena-cap-recipes -s http://gems.github.com/
|
43
19
|
|
44
|
-
|
45
|
-
require 'cap_recipes/tasks/memcache/manage.rb' # memcache daemon management tasks
|
46
|
-
require 'cap_recipes/tasks/memcache/hooks.rb' # memcache deployment hooks
|
20
|
+
Include into your deploy.rb configuration file for Capistrano:
|
47
21
|
|
22
|
+
<pre>
|
23
|
+
<code>
|
24
|
+
# use the complete deployment process
|
25
|
+
require 'cap_recipes'
|
26
|
+
|
27
|
+
# OR
|
28
|
+
# use a single slice of the deployment process
|
29
|
+
# (use hooks which tie all the recipes into the deployment process,
|
30
|
+
# tasks for managing and tasks for installing):
|
31
|
+
# substitude memcache with: passenger, rails, apache, backgroundrb, juggernaut
|
32
|
+
require 'cap_recipes/tasks/memcache'
|
33
|
+
|
34
|
+
# OR
|
35
|
+
# only use managing tasks:
|
36
|
+
require 'cap_recipes/tasks/memcache/manage'
|
37
|
+
|
38
|
+
# OR
|
39
|
+
#only use install tasks:
|
40
|
+
require 'cap_recipes/tasks/memcache/install'
|
41
|
+
</code>
|
42
|
+
</pre>
|
43
|
+
|
48
44
|
h2. USAGE
|
49
45
|
|
50
46
|
h3. Apache
|
@@ -98,7 +94,7 @@ h3. Rails
|
|
98
94
|
|
99
95
|
h4. Tasks
|
100
96
|
|
101
|
-
h5.
|
97
|
+
h5. manage.rb
|
102
98
|
|
103
99
|
rails
|
104
100
|
:symlink_db_config
|
data/VERSION.yml
CHANGED
@@ -45,5 +45,23 @@ Capistrano::Configuration.instance(true).load do
|
|
45
45
|
sudo "mv /tmp/passenger /etc/apache2/conf.d/passenger"
|
46
46
|
apache.restart
|
47
47
|
end
|
48
|
+
|
49
|
+
# if you want to add more options, try this, in your own conifg
|
50
|
+
# read this first... http://www.modrails.com/documentation/Users%20guide.html
|
51
|
+
# namespace :passenger do
|
52
|
+
# task :add_custom_configuration, :roles=>:web do
|
53
|
+
# #512 - 100(stack) - 4*100(instance)
|
54
|
+
# passenger_config = <<EOF
|
55
|
+
# PassengerMaxPoolSize 4
|
56
|
+
# PassengerPoolIdleTime 3000
|
57
|
+
# EOF
|
58
|
+
# put passenger_config, "/tmp/passenger"
|
59
|
+
# sudo "cat /tmp/passenger >> /etc/apache2/conf.d/passenger"
|
60
|
+
# apache.restart
|
61
|
+
# end
|
62
|
+
# end
|
63
|
+
# after "passenger:update_config", *%w(
|
64
|
+
# passenger:add_custom_configuration
|
65
|
+
# )
|
48
66
|
end
|
49
67
|
end
|
File without changes
|
data/spec/cap/helper.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
require File.expand_path("spec_helper", File.dirname(__FILE__))
|
2
|
+
|
3
|
+
describe 'loading everything' do
|
4
|
+
def run_cap(folder,task)
|
5
|
+
folder = File.join(File.dirname(__FILE__),'cap',folder)
|
6
|
+
`cd #{folder} && #{task}`
|
7
|
+
end
|
8
|
+
|
9
|
+
it "finds all tasks" do
|
10
|
+
tasks = run_cap 'all', 'cap -T'
|
11
|
+
tasks.split("\n").size.should >= 20
|
12
|
+
end
|
13
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# ---- requirements
|
2
|
+
require 'rubygems'
|
3
|
+
require 'spec'
|
4
|
+
|
5
|
+
$LOAD_PATH << File.expand_path("../lib", File.dirname(__FILE__))
|
6
|
+
|
7
|
+
# ---- bugfix
|
8
|
+
#`exit?': undefined method `run?' for Test::Unit:Module (NoMethodError)
|
9
|
+
#can be solved with require test/unit but this will result in extra test-output
|
10
|
+
module Test
|
11
|
+
module Unit
|
12
|
+
def self.run?
|
13
|
+
true
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grosser-cap-recipes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.21
|
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-02-
|
12
|
+
date: 2009-02-16 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -49,12 +49,16 @@ files:
|
|
49
49
|
- lib/cap_recipes/tasks/passenger.rb
|
50
50
|
- lib/cap_recipes/tasks/rails
|
51
51
|
- lib/cap_recipes/tasks/rails/hooks.rb
|
52
|
-
- lib/cap_recipes/tasks/rails/
|
52
|
+
- lib/cap_recipes/tasks/rails/manage.rb
|
53
53
|
- lib/cap_recipes/tasks/rails.rb
|
54
54
|
- lib/cap_recipes/tasks/with_scope.rb
|
55
55
|
- lib/cap_recipes.rb
|
56
|
-
-
|
57
|
-
-
|
56
|
+
- spec/cap
|
57
|
+
- spec/cap/all
|
58
|
+
- spec/cap/all/Capfile
|
59
|
+
- spec/cap/helper.rb
|
60
|
+
- spec/cap_recipes_spec.rb
|
61
|
+
- spec/spec_helper.rb
|
58
62
|
has_rdoc: true
|
59
63
|
homepage: http://github.com/nesquena/cap-recipes
|
60
64
|
post_install_message:
|
data/test/cap_recipes_test.rb
DELETED