nesquena-cap-recipes 0.3.11 → 0.3.12
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/Rakefile +2 -2
- data/VERSION.yml +1 -1
- data/cap-recipes.gemspec +4 -4
- data/lib/cap_recipes/tasks/delayed_job/manage.rb +16 -10
- data/lib/cap_recipes/tasks/juggernaut/manage.rb +30 -23
- data/lib/cap_recipes/tasks/passenger/manage.rb +0 -9
- metadata +4 -4
data/Rakefile
CHANGED
@@ -7,10 +7,10 @@ begin
|
|
7
7
|
require 'jeweler'
|
8
8
|
Jeweler::Tasks.new do |s|
|
9
9
|
s.name = "cap-recipes"
|
10
|
-
s.summary = %Q{Battle-tested capistrano recipes for passenger,
|
10
|
+
s.summary = %Q{Battle-tested capistrano recipes for passenger, delayed_job, and more}
|
11
11
|
s.email = "nesquena@gmail.com"
|
12
12
|
s.homepage = "http://github.com/nesquena/cap-recipes"
|
13
|
-
s.description = "Battle-tested capistrano recipes for passenger, apache, and more"
|
13
|
+
s.description = "Battle-tested capistrano recipes for passenger, apache, delayed_job, juggernaut, backgroundrb, rails and more"
|
14
14
|
s.authors = ["Nathan Esquenazi"]
|
15
15
|
end
|
16
16
|
rescue LoadError
|
data/VERSION.yml
CHANGED
data/cap-recipes.gemspec
CHANGED
@@ -2,12 +2,12 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{cap-recipes}
|
5
|
-
s.version = "0.3.
|
5
|
+
s.version = "0.3.12"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Nathan Esquenazi"]
|
9
|
-
s.date = %q{2009-05-
|
10
|
-
s.description = %q{Battle-tested capistrano recipes for passenger, apache, and more}
|
9
|
+
s.date = %q{2009-05-21}
|
10
|
+
s.description = %q{Battle-tested capistrano recipes for passenger, apache, delayed_job, juggernaut, backgroundrb, rails and more}
|
11
11
|
s.email = %q{nesquena@gmail.com}
|
12
12
|
s.extra_rdoc_files = [
|
13
13
|
"LICENSE",
|
@@ -53,7 +53,7 @@ Gem::Specification.new do |s|
|
|
53
53
|
s.rdoc_options = ["--charset=UTF-8"]
|
54
54
|
s.require_paths = ["lib"]
|
55
55
|
s.rubygems_version = %q{1.3.3}
|
56
|
-
s.summary = %q{Battle-tested capistrano recipes for passenger,
|
56
|
+
s.summary = %q{Battle-tested capistrano recipes for passenger, delayed_job, and more}
|
57
57
|
s.test_files = [
|
58
58
|
"spec/cap/helper.rb",
|
59
59
|
"spec/cap_recipes_spec.rb",
|
@@ -1,26 +1,32 @@
|
|
1
1
|
Capistrano::Configuration.instance(true).load do
|
2
|
-
set :delayed_script_path,
|
2
|
+
set :delayed_script_path, "#{current_path}/script/delayed_job"
|
3
3
|
set :delayed_job_env, 'production'
|
4
|
-
set :
|
5
|
-
|
4
|
+
set :delayed_job_role, :app
|
5
|
+
set :base_ruby_path, '/usr'
|
6
|
+
|
6
7
|
namespace :delayed_job do
|
7
8
|
desc "Start delayed_job process"
|
8
9
|
task :start, :roles => :app do
|
9
|
-
|
10
|
+
with_role(delayed_job_role) do
|
11
|
+
try_sudo "#{base_ruby_path}/bin/ruby #{delayed_script_path} start #{delayed_job_env}"
|
12
|
+
end
|
10
13
|
end
|
11
14
|
|
12
15
|
desc "Stop delayed_job process"
|
13
16
|
task :stop, :roles => :app do
|
14
|
-
|
17
|
+
with_role(delayed_job_role) do
|
18
|
+
try_sudo "#{base_ruby_path}/bin/ruby #{delayed_script_path} stop #{delayed_job_env}"
|
19
|
+
end
|
15
20
|
end
|
16
21
|
|
17
22
|
desc "Restart delayed_job process"
|
18
23
|
task :restart, :roles => :app do
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
+
with_role(delayed_job_role) do
|
25
|
+
delayed_job.stop
|
26
|
+
sleep(4)
|
27
|
+
try_sudo "killall -s TERM delayed_job; true"
|
28
|
+
delayed_job.start
|
29
|
+
end
|
24
30
|
end
|
25
31
|
end
|
26
32
|
end
|
@@ -2,46 +2,53 @@ Capistrano::Configuration.instance(true).load do
|
|
2
2
|
set :juggernaut_config, "#{current_path}/config/juggernaut.yml"
|
3
3
|
set :juggernaut_pid, "#{current_path}/tmp/pids/juggernaut.pid"
|
4
4
|
set :juggernaut_log, "#{current_path}/log/juggernaut.log"
|
5
|
-
set :
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
set :juggernaut_role, :app
|
6
|
+
set :base_ruby_path, '/usr'
|
7
|
+
|
8
|
+
namespace :juggernaut do
|
9
|
+
|
9
10
|
# ===============================================================
|
10
11
|
# PROCESS MANAGEMENT
|
11
|
-
# ===============================================================
|
12
|
-
|
12
|
+
# ===============================================================
|
13
|
+
|
13
14
|
desc "Starts the juggernaut push server"
|
14
15
|
task :start, :roles => :app do
|
15
|
-
|
16
|
-
|
16
|
+
with_role(juggernaut_role) do
|
17
|
+
puts "Starting juggernaut push server"
|
18
|
+
try_sudo "#{base_ruby_path}/bin/juggernaut -c #{juggernaut_config} -d --pid #{juggernaut_pid} --log #{juggernaut_log}"
|
19
|
+
end
|
17
20
|
end
|
18
|
-
|
21
|
+
|
19
22
|
desc "Stops the juggernaut push server"
|
20
23
|
task :stop, :roles => :app do
|
21
|
-
|
22
|
-
|
24
|
+
with_role(juggernaut_role) do
|
25
|
+
puts "Stopping juggernaut push server"
|
26
|
+
try_sudo "#{base_ruby_path}/bin/juggernaut -c #{juggernaut_config} -k * --pid #{juggernaut_pid} --log #{juggernaut_log}"
|
27
|
+
end
|
23
28
|
end
|
24
|
-
|
29
|
+
|
25
30
|
desc "Restarts the juggernaut push server"
|
26
31
|
task :restart, :roles => :app do
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
32
|
+
with_role(juggernaut_role) do
|
33
|
+
juggernaut.stop
|
34
|
+
juggernaut.start
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
31
38
|
# ===============================================================
|
32
39
|
# FILE MANAGEMENT
|
33
|
-
# ===============================================================
|
34
|
-
|
40
|
+
# ===============================================================
|
41
|
+
|
35
42
|
desc "Symlinks the shared/config/juggernaut yaml to release/config/"
|
36
43
|
task :symlink_config, :roles => :app do
|
37
44
|
try_sudo "ln -s #{shared_path}/config/juggernaut.yml #{release_path}/config/juggernaut.yml"
|
38
45
|
end
|
39
|
-
|
46
|
+
|
40
47
|
desc "Displays the juggernaut log from the server"
|
41
48
|
task :tail, :roles => :app do
|
42
|
-
stream "tail -f #{shared_path}/log/juggernaut.log"
|
49
|
+
stream "tail -f #{shared_path}/log/juggernaut.log"
|
43
50
|
end
|
44
|
-
|
51
|
+
|
45
52
|
end
|
46
|
-
|
47
|
-
end
|
53
|
+
|
54
|
+
end
|
@@ -27,15 +27,6 @@ Capistrano::Configuration.instance(true).load do
|
|
27
27
|
task :restart, :roles => :web do
|
28
28
|
run "touch #{current_path}/tmp/restart.txt"
|
29
29
|
end
|
30
|
-
|
31
|
-
desc "Update code on server, apply migrations, and restart passenger server"
|
32
|
-
task :with_migrations, :roles => :web do
|
33
|
-
with_role(:web) do
|
34
|
-
deploy.update
|
35
|
-
deploy.migrate
|
36
|
-
deploy.restart
|
37
|
-
end
|
38
|
-
end
|
39
30
|
|
40
31
|
end
|
41
32
|
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.3.
|
4
|
+
version: 0.3.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Esquenazi
|
@@ -9,11 +9,11 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-05-
|
12
|
+
date: 2009-05-21 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
16
|
-
description: Battle-tested capistrano recipes for passenger, apache, and more
|
16
|
+
description: Battle-tested capistrano recipes for passenger, apache, delayed_job, juggernaut, backgroundrb, rails and more
|
17
17
|
email: nesquena@gmail.com
|
18
18
|
executables: []
|
19
19
|
|
@@ -82,7 +82,7 @@ rubyforge_project:
|
|
82
82
|
rubygems_version: 1.2.0
|
83
83
|
signing_key:
|
84
84
|
specification_version: 3
|
85
|
-
summary: Battle-tested capistrano recipes for passenger,
|
85
|
+
summary: Battle-tested capistrano recipes for passenger, delayed_job, and more
|
86
86
|
test_files:
|
87
87
|
- spec/cap/helper.rb
|
88
88
|
- spec/cap_recipes_spec.rb
|