nesquena-cap-recipes 0.2.4 → 0.2.6

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,12 +7,13 @@ h2. INSTALLATION
7
7
 
8
8
  h2. DESCRIPTION
9
9
 
10
- This is a collection of capistrano recipes which will grow to encompass many useful recipes. The intended use for these recipes is for a rails project which deploys using the Phusion Passenger module of Apache. In addition, recipes for the management of various daemon processes will be included as needed. Feel free to contribute to this and make it better!
10
+ This is a collection of capistrano recipes which will grow to encompass many useful recipes. The intended use for these recipes is for a ruby project which deploys using Phusion Passenger and caches using memcached. In addition, recipes for the management of various daemon processes will be included as needed. Feel free to contribute to this and make it better!
11
11
 
12
12
  Currently included:
13
13
 
14
14
  * Phusion Passenger (Setup and Deployment)
15
15
  * Apache Server
16
+ * Memcache Process
16
17
  * Juggernaut Daemon
17
18
  * Backgroundrb Server
18
19
 
data/Rakefile CHANGED
@@ -5,7 +5,7 @@ require 'rake/gempackagetask'
5
5
  require 'spec/rake/spectask'
6
6
 
7
7
  GEM = "cap-recipes"
8
- GEM_VERSION = "0.2.4"
8
+ GEM_VERSION = "0.2.6"
9
9
  SUMMARY = "Collection of capistrano recipes for apache, passenger, memcache, juggernaut and backgroundrb"
10
10
  AUTHOR = "Nathan Esquenazi"
11
11
  EMAIL = "nesquena@gmail.com"
@@ -8,19 +8,19 @@ Capistrano::Configuration.instance(true).load do
8
8
 
9
9
  namespace :apache do
10
10
  desc "Stops the apache web server"
11
- task :stop, :role => :app do
11
+ task :stop, :roles => :web do
12
12
  puts "Stopping the apache server"
13
13
  sudo "#{apache_init_path} stop"
14
14
  end
15
15
 
16
16
  desc "Starts the apache web server"
17
- task :start, :role => :app do
17
+ task :start, :roles => :web do
18
18
  puts "Starting the apache server"
19
19
  sudo "#{apache_init_path} start"
20
20
  end
21
21
 
22
22
  desc "Restarts the apache web server"
23
- task :restart, :role => :app do
23
+ task :restart, :roles => :web do
24
24
  puts "Restarting the apache server"
25
25
  sudo "#{apache_init_path} restart"
26
26
  end
@@ -10,17 +10,17 @@ Capistrano::Configuration.instance(true).load do
10
10
  # ===============================================================
11
11
 
12
12
  desc "Stops the backgroundrb worker processes"
13
- task :stop, :role => :app do
13
+ task :stop, :roles => :app do
14
14
  run "cd #{current_path} && #{sudo} ruby script/backgroundrb stop -e #{backgroundrb_env}"
15
15
  end
16
16
 
17
17
  desc "Starts the backgroundrb worker processes"
18
- task :start, :role => :app do
18
+ task :start, :roles => :app do
19
19
  run "cd #{current_path} && #{sudo} nohup ruby script/backgroundrb start -e #{backgroundrb_env}"
20
20
  end
21
21
 
22
22
  desc "Restarts a running backgroundrb server."
23
- task :restart, :role => :app do
23
+ task :restart, :roles => :app do
24
24
  backgroundrb.stop
25
25
  sleep(5) # sleep for 5 seconds to make sure the server has mopped up everything
26
26
  backgroundrb.start
@@ -31,7 +31,7 @@ Capistrano::Configuration.instance(true).load do
31
31
  # ===============================================================
32
32
 
33
33
  desc "Creates configuration file for the backgroundrb server"
34
- task :configure, :role => :app do
34
+ task :configure, :roles => :app do
35
35
  config = { :backgroundrb => {:ip => backgroundrb_host, :port => backgroundrb_port, :environment => backgroundrb_env} }
36
36
  backgroundrb_yml = config.to_yaml
37
37
 
@@ -44,7 +44,7 @@ Capistrano::Configuration.instance(true).load do
44
44
  # ===============================================================
45
45
 
46
46
  desc "Copies the shared/config/backgroundrb yaml to release/config/"
47
- task :copy_config, :role => :app do
47
+ task :copy_config, :roles => :app do
48
48
  on_rollback {
49
49
  puts "***** File shared/config/backgroundrb.yml is missing. Make sure you have run backgroundrb:configure first. *****"
50
50
  }
@@ -58,7 +58,7 @@ Capistrano::Configuration.instance(true).load do
58
58
  end
59
59
 
60
60
  desc "Repair permissions to allow user to perform all actions"
61
- task :repair_permissions, :role => :app do
61
+ task :repair_permissions, :roles => :app do
62
62
  puts "Applying correct permissions to allow for proper command execution"
63
63
  sudo "chown -R #{user}:#{user} #{current_path}"
64
64
  sudo "chown -R #{user}:#{user} #{current_path}/tmp"
@@ -9,19 +9,19 @@ Capistrano::Configuration.instance(true).load do
9
9
  # ===============================================================
10
10
 
11
11
  desc "Starts the juggernaut push server"
12
- task :start, :role => :app do
12
+ task :start, :roles => :app do
13
13
  puts "Starting juggernaut push server"
14
14
  sudo "#{sudo} juggernaut -c #{juggernaut_config} -d --pid #{juggernaut_pid} --log #{juggernaut_log}"
15
15
  end
16
16
 
17
17
  desc "Stops the juggernaut push server"
18
- task :stop, :role => :app do
18
+ task :stop, :roles => :app do
19
19
  puts "Stopping juggernaut push server"
20
20
  sudo "#{sudo} juggernaut -c #{juggernaut_config} -k * --pid #{juggernaut_pid} --log #{juggernaut_log}"
21
21
  end
22
22
 
23
23
  desc "Restarts the juggernaut push server"
24
- task :restart, :role => :app do
24
+ task :restart, :roles => :app do
25
25
  juggernaut.stop
26
26
  juggernaut.start
27
27
  end
@@ -31,12 +31,12 @@ Capistrano::Configuration.instance(true).load do
31
31
  # ===============================================================
32
32
 
33
33
  desc "Copies the shared/config/juggernaut yaml to release/config/"
34
- task :copy_config, :role => :app do
34
+ task :copy_config, :roles => :app do
35
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"
39
- task :tail, :role => :app do
39
+ task :tail, :roles => :app do
40
40
  stream "tail -f #{shared_path}/log/juggernaut.log"
41
41
  end
42
42
  end
@@ -8,19 +8,19 @@ Capistrano::Configuration.instance(true).load do
8
8
 
9
9
  namespace :memcache do
10
10
  desc "Stops the memcache server"
11
- task :stop, :role => :app do
11
+ task :stop, :roles => :app do
12
12
  puts "Stopping the memcache server"
13
13
  sudo "#{memcache_init_path} stop"
14
14
  end
15
15
 
16
16
  desc "Starts the memcache server"
17
- task :start, :role => :app do
17
+ task :start, :roles => :app do
18
18
  puts "Starting the memcache server"
19
19
  sudo "#{memcache_init_path} start"
20
20
  end
21
21
 
22
22
  desc "Restarts the memcache server"
23
- task :restart, :role => :app do
23
+ task :restart, :roles => :app do
24
24
  puts "Restarting the memcache server"
25
25
  memcache.stop
26
26
  memcache.start
@@ -31,7 +31,7 @@ Capistrano::Configuration.instance(true).load do
31
31
  # ===============================================================
32
32
 
33
33
  desc 'Installs memcache and the ruby gem'
34
- task :install, :roles => :web do
34
+ task :install, :roles => :app do
35
35
  puts 'Installing memcache'
36
36
  sudo 'apt-get install memcached'
37
37
  sudo "#{base_ruby_path}/bin/gem install memcache-client --no-ri --no-rdoc"
@@ -12,25 +12,25 @@ Capistrano::Configuration.instance(true).load do
12
12
  # ===============================================================
13
13
 
14
14
  desc "Stops the phusion passenger server"
15
- task :stop, :role => :app do
15
+ task :stop, :roles => :web do
16
16
  puts "Stopping rails web server"
17
17
  apache.stop
18
18
  end
19
19
 
20
20
  desc "Starts the phusion passenger server"
21
- task :start, :role => :app do
21
+ task :start, :roles => :web do
22
22
  puts "Starting rails web server"
23
23
  apache.start
24
24
  end
25
25
 
26
26
  desc "Restarts the phusion passenger server"
27
- task :restart, :role => :app do
27
+ task :restart, :roles => :web do
28
28
  puts "Restarting the application"
29
29
  run "touch #{current_path}/tmp/restart.txt"
30
30
  end
31
31
 
32
32
  desc "Update code on server, apply migrations, and restart passenger server"
33
- task :with_migrations, :role => :app do
33
+ task :with_migrations, :roles => :web do
34
34
  deploy.update
35
35
  deploy.migrate
36
36
  deploy.restart
@@ -41,13 +41,13 @@ Capistrano::Configuration.instance(true).load do
41
41
  # ===============================================================
42
42
 
43
43
  desc "Copies the shared/config/database yaml to release/config/"
44
- task :copy_config, :role => :app do
44
+ task :copy_config, :roles => :web do
45
45
  puts "Copying database configuration to release path"
46
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"
50
- task :repair_permissions, :role => :app do
50
+ task :repair_permissions, :roles => :web do
51
51
  puts "Applying correct permissions to allow for proper command execution"
52
52
  sudo "chmod -R 744 #{current_path}/log #{current_path}/tmp"
53
53
  sudo "chown -R #{user}:#{user} #{current_path}"
@@ -55,7 +55,7 @@ Capistrano::Configuration.instance(true).load do
55
55
  end
56
56
 
57
57
  desc "Displays the production log from the server locally"
58
- task :tail, :role => :app do
58
+ task :tail, :roles => :web do
59
59
  stream "tail -f #{shared_path}/log/production.log"
60
60
  end
61
61
 
@@ -68,19 +68,19 @@ Capistrano::Configuration.instance(true).load do
68
68
  namespace :install do
69
69
 
70
70
  desc "Updates all installed ruby gems"
71
- task :gems, :role => :app do
71
+ task :gems, :roles => :web do
72
72
  sudo "gem update"
73
73
  end
74
74
 
75
75
  desc "Installs Phusion Passenger"
76
- task :passenger, :role => :app do
76
+ task :passenger, :roles => :web do
77
77
  puts 'Installing passenger module'
78
78
  install.passenger_apache_module
79
79
  install.config_passenger
80
80
  end
81
81
 
82
82
  desc "Setup Passenger Module"
83
- task :passenger_apache_module do
83
+ task :passenger_apache_module, :roles => :web do
84
84
  sudo "#{base_ruby_path}/bin/gem install passenger --no-ri --no-rdoc"
85
85
  input = ''
86
86
  run "sudo #{base_ruby_path}/bin/passenger-install-apache2-module" do |ch, stream, out|
@@ -91,7 +91,7 @@ Capistrano::Configuration.instance(true).load do
91
91
  end
92
92
 
93
93
  desc "Configure Passenger"
94
- task :config_passenger do
94
+ task :config_passenger, :roles => :web do
95
95
  version = 'ERROR' # default
96
96
 
97
97
  # passenger (2.X.X, 1.X.X)
@@ -117,15 +117,15 @@ Capistrano::Configuration.instance(true).load do
117
117
  # ===============================================================
118
118
  # MAINTENANCE TASKS
119
119
  # ===============================================================
120
- namespace :sweep do
120
+ namespace :sweep, :roles => :web do
121
121
  desc "Clear file-based fragment and action caching"
122
- task :log, :role => :app do
122
+ task :log, :roles => :app do
123
123
  puts "Sweeping all the log files"
124
124
  run "cd #{current_path} && #{sudo} rake log:clear RAILS_ENV=production"
125
125
  end
126
126
 
127
127
  desc "Clear file-based fragment and action caching"
128
- task :cache, :role => :app do
128
+ task :cache, :roles => :web do
129
129
  puts "Sweeping the fragment and action cache stores"
130
130
  run "cd #{release_path} && #{sudo} rake tmp:cache:clear RAILS_ENV=production"
131
131
  end
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.4
4
+ version: 0.2.6
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-01-07 00:00:00 -08:00
12
+ date: 2009-01-25 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies: []
15
15