nesquena-cap-recipes 0.2.2 → 0.2.3

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
@@ -24,6 +24,11 @@ To include any of these into your deploy.rb configuration file for Capistrano:
24
24
  require 'cap_recipes/tasks/apache'
25
25
  require 'cap_recipes/tasks/backgroundrb'
26
26
  require 'cap_recipes/tasks/juggernaut'
27
+ require 'cap_recipes/tasks/memcache'
28
+
29
+ Or to include and activate all of them:
30
+
31
+ require 'cap_recipes'
27
32
 
28
33
  h2. USAGE
29
34
 
@@ -105,6 +110,21 @@ h4. Tasks
105
110
  :restart
106
111
  :copy_config
107
112
  :tail
113
+
114
+ h3. Memcache
115
+
116
+ h4. Configuration
117
+
118
+ * memcache_init_path - path to memcache config file [default: "/etc/init.d/memcache"]
119
+
120
+ h4. Tasks
121
+
122
+ tasks:
123
+ memcache
124
+ :start
125
+ :stop
126
+ :restart
127
+ :install
108
128
 
109
129
  h2. LICENSE:
110
130
 
data/Rakefile CHANGED
@@ -5,8 +5,8 @@ require 'rake/gempackagetask'
5
5
  require 'spec/rake/spectask'
6
6
 
7
7
  GEM = "cap-recipes"
8
- GEM_VERSION = "0.2.2"
9
- SUMMARY = "Collection of capistrano recipes for apache, passenger, juggernaut and backgroundrb"
8
+ GEM_VERSION = "0.2.3"
9
+ SUMMARY = "Collection of capistrano recipes for apache, passenger, memcache, juggernaut and backgroundrb"
10
10
  AUTHOR = "Nathan Esquenazi"
11
11
  EMAIL = "nesquena@gmail.com"
12
12
  HOMEPAGE = "http://caprecipes.rubyforge.org"
@@ -49,7 +49,7 @@ Capistrano::Configuration.instance(true).load do
49
49
  puts "***** File shared/config/backgroundrb.yml is missing. Make sure you have run backgroundrb:configure first. *****"
50
50
  }
51
51
 
52
- run "cp #{shared_path}/config/backgroundrb.yml #{release_path}/config/"
52
+ run "ln -s #{shared_path}/config/backgroundrb.yml #{release_path}/config/backgroundrb.yml"
53
53
  end
54
54
 
55
55
  desc "Displays the backgroundrb log from the server"
@@ -32,7 +32,7 @@ Capistrano::Configuration.instance(true).load do
32
32
 
33
33
  desc "Copies the shared/config/juggernaut yaml to release/config/"
34
34
  task :copy_config, :role => :app do
35
- sudo "cp #{shared_path}/config/juggernaut.yml #{release_path}/config/"
35
+ sudo "ln -s #{shared_path}/config/juggernaut.yml #{release_path}/config/juggernaut.yml"
36
36
  end
37
37
 
38
38
  desc "Displays the juggernaut log from the server"
@@ -0,0 +1,42 @@
1
+ Capistrano::Configuration.instance(true).load do
2
+
3
+ set :memcache_init_path, "/etc/init.d/memcache"
4
+
5
+ # ===============================================================
6
+ # SERVER MANAGEMENT
7
+ # ===============================================================
8
+
9
+ namespace :memcache do
10
+ desc "Stops the memcache server"
11
+ task :stop, :role => :app do
12
+ puts "Stopping the memcache server"
13
+ sudo "#{memcache_init_path} stop"
14
+ end
15
+
16
+ desc "Starts the memcache server"
17
+ task :start, :role => :app do
18
+ puts "Starting the memcache server"
19
+ sudo "#{memcache_init_path} start"
20
+ end
21
+
22
+ desc "Restarts the memcache server"
23
+ task :restart, :role => :app do
24
+ puts "Restarting the memcache server"
25
+ sudo "#{memcache_init_path} restart"
26
+ end
27
+
28
+ # ===============================================================
29
+ # INSTALLATION
30
+ # ===============================================================
31
+
32
+ desc 'Installs memcache and the ruby gem'
33
+ task :install, :roles => :web do
34
+ puts 'Installing memcache'
35
+ sudo 'apt-get install memcached'
36
+ sudo "#{base_ruby_path}/bin/gem install memcache-client --no-ri --no-rdoc"
37
+ memcache.start
38
+ end
39
+ end
40
+
41
+ after "deploy:update_code", "memcache:restart" # clear cache after updating code
42
+ end
@@ -43,7 +43,7 @@ Capistrano::Configuration.instance(true).load do
43
43
  desc "Copies the shared/config/database yaml to release/config/"
44
44
  task :copy_config, :role => :app do
45
45
  puts "Copying database configuration to release path"
46
- sudo "cp #{shared_path}/config/database.yml #{release_path}/config/"
46
+ sudo "ln -s #{shared_path}/config/database.yml #{release_path}/config/database.yml"
47
47
  end
48
48
 
49
49
  desc "Repair permissions to allow user to perform all actions"
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.2.2
4
+ version: 0.2.3
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: 2008-12-16 00:00:00 -08:00
12
+ date: 2009-01-04 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -27,6 +27,7 @@ files:
27
27
  - lib/cap_recipes/tasks/apache.rb
28
28
  - lib/cap_recipes/tasks/backgroundrb.rb
29
29
  - lib/cap_recipes/tasks/juggernaut.rb
30
+ - lib/cap_recipes/tasks/memcache.rb
30
31
  - lib/cap_recipes/tasks/passenger.rb
31
32
  - lib/cap_recipes.rb
32
33
  - spec/cap-recipes-spec.rb
@@ -55,6 +56,6 @@ rubyforge_project: cap-recipes
55
56
  rubygems_version: 1.2.0
56
57
  signing_key:
57
58
  specification_version: 2
58
- summary: Collection of capistrano recipes for apache, passenger, juggernaut and backgroundrb
59
+ summary: Collection of capistrano recipes for apache, passenger, memcache, juggernaut and backgroundrb
59
60
  test_files: []
60
61