capobvious 0.1.6 → 0.1.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/bin/capobvious +46 -1
- data/capobvious.gemspec +1 -1
- data/lib/capistrano/ext/capobvious.rb +1 -1
- data/lib/capobvious/version.rb +1 -1
- metadata +19 -11
- data/bin/unicorn.rb +0 -43
data/bin/capobvious
CHANGED
@@ -44,7 +44,7 @@ load 'config/deploy' # remove this line to skip loading any of the default tasks
|
|
44
44
|
require 'capistrano/ext/capobvious'
|
45
45
|
FILE
|
46
46
|
|
47
|
-
"config/deploy.rb" => <<FILE
|
47
|
+
"config/deploy.rb" => <<FILE,
|
48
48
|
# -*- encoding : utf-8 -*-
|
49
49
|
set :rvm_ruby_string, '1.9.3'
|
50
50
|
set :application, "appname"
|
@@ -64,6 +64,51 @@ set :auto_migrate, true
|
|
64
64
|
role :app, serv
|
65
65
|
role :web, serv
|
66
66
|
role :db, serv, :primary => true
|
67
|
+
FILE
|
68
|
+
"config/unicorn.rb" => <<FILE
|
69
|
+
# -*- encoding : utf-8 -*-
|
70
|
+
APP_PATH = File.expand_path(File.dirname(File.dirname(__FILE__)))
|
71
|
+
SHARED_PATH = File.expand_path(APP_PATH+"/../shared")
|
72
|
+
|
73
|
+
working_directory APP_PATH
|
74
|
+
|
75
|
+
pid_file = SHARED_PATH + "/pids/unicorn.pid"
|
76
|
+
socket_file= SHARED_PATH + "/pids/unicorn.sock"
|
77
|
+
log_file = APP_PATH + "/log/unicorn.log"
|
78
|
+
err_log = APP_PATH + "/log/unicorn.stderr.log"
|
79
|
+
old_pid = pid_file + '.oldbin'
|
80
|
+
|
81
|
+
|
82
|
+
timeout 30
|
83
|
+
worker_processes 2
|
84
|
+
preload_app true
|
85
|
+
listen socket_file, :backlog => 1024
|
86
|
+
pid pid_file
|
87
|
+
stderr_path err_log
|
88
|
+
stdout_path log_file
|
89
|
+
|
90
|
+
GC.copy_on_write_friendly = true if GC.respond_to?(:copy_on_write_friendly=)
|
91
|
+
|
92
|
+
|
93
|
+
before_exec do |server|
|
94
|
+
ENV["BUNDLE_GEMFILE"] = APP_PATH}+"/Gemfile"
|
95
|
+
end
|
96
|
+
|
97
|
+
before_fork do |server, worker|
|
98
|
+
defined?(ActiveRecord::Base) && ActiveRecord::Base.connection.disconnect!
|
99
|
+
|
100
|
+
if File.exists?(old_pid) && server.pid != old_pid
|
101
|
+
begin
|
102
|
+
#sig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOU
|
103
|
+
Process.kill("QUIT", File.read(old_pid).to_i)
|
104
|
+
rescue Errno::ENOENT, Errno::ESRCH
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
after_fork do |server, worker|
|
110
|
+
defined?(ActiveRecord::Base) && ActiveRecord::Base.establish_connection
|
111
|
+
end
|
67
112
|
FILE
|
68
113
|
}
|
69
114
|
|
data/capobvious.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
19
|
s.require_paths = ["lib"]
|
20
20
|
|
21
|
-
s.add_dependency "capistrano"
|
21
|
+
s.add_dependency "capistrano", "~> 2.12.0"
|
22
22
|
s.add_dependency "rvm-capistrano"
|
23
23
|
|
24
24
|
# specify any dependencies here; for example:
|
@@ -80,7 +80,7 @@ Capistrano::Configuration.instance.load do
|
|
80
80
|
end
|
81
81
|
desc "Assets precompile"
|
82
82
|
task :precompile, :roles => :web, :except => { :no_release => true } do
|
83
|
-
run("cd #{latest_release} && bundle exec rake RAILS_ENV=#{rails_env}
|
83
|
+
run("cd #{latest_release} && bundle exec rake RAILS_ENV=#{rails_env} assets:precompile")
|
84
84
|
end
|
85
85
|
task :symlink, :roles => :web, :except => { :no_release => true } do
|
86
86
|
run <<-CMD
|
data/lib/capobvious/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capobvious
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,22 +9,27 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-05-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capistrano
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
21
|
+
version: 2.12.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 2.12.0
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: rvm-capistrano
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ! '>='
|
@@ -32,13 +37,17 @@ dependencies:
|
|
32
37
|
version: '0'
|
33
38
|
type: :runtime
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
36
46
|
description: Capfile that we use every day
|
37
47
|
email:
|
38
48
|
- donotsendhere@gmail.com
|
39
49
|
executables:
|
40
50
|
- capobvious
|
41
|
-
- unicorn.rb
|
42
51
|
extensions: []
|
43
52
|
extra_rdoc_files: []
|
44
53
|
files:
|
@@ -47,7 +56,6 @@ files:
|
|
47
56
|
- README.markdown
|
48
57
|
- Rakefile
|
49
58
|
- bin/capobvious
|
50
|
-
- bin/unicorn.rb
|
51
59
|
- capobvious.gemspec
|
52
60
|
- lib/capistrano/ext/capobvious.rb
|
53
61
|
- lib/capobvious/version.rb
|
@@ -71,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
71
79
|
version: '0'
|
72
80
|
requirements: []
|
73
81
|
rubyforge_project: capobvious
|
74
|
-
rubygems_version: 1.8.
|
82
|
+
rubygems_version: 1.8.23
|
75
83
|
signing_key:
|
76
84
|
specification_version: 3
|
77
85
|
summary: Cap recipes
|
data/bin/unicorn.rb
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
2
|
-
APP_PATH = File.expand_path(File.dirname(File.dirname(__FILE__)))
|
3
|
-
SHARED_PATH = File.expand_path(APP_PATH+"/../shared")
|
4
|
-
|
5
|
-
working_directory APP_PATH
|
6
|
-
|
7
|
-
pid_file = SHARED_PATH + "/pids/unicorn.pid"
|
8
|
-
socket_file= SHARED_PATH + "/pids/unicorn.sock"
|
9
|
-
log_file = APP_PATH + "/log/unicorn.log"
|
10
|
-
err_log = APP_PATH + "/log/unicorn.stderr.log"
|
11
|
-
old_pid = pid_file + '.oldbin'
|
12
|
-
|
13
|
-
|
14
|
-
timeout 30
|
15
|
-
worker_processes 4
|
16
|
-
preload_app true
|
17
|
-
listen socket_file, :backlog => 1024
|
18
|
-
pid pid_file
|
19
|
-
stderr_path err_log
|
20
|
-
stdout_path log_file
|
21
|
-
|
22
|
-
GC.copy_on_write_friendly = true if GC.respond_to?(:copy_on_write_friendly=)
|
23
|
-
|
24
|
-
|
25
|
-
before_exec do |server|
|
26
|
-
ENV["BUNDLE_GEMFILE"] = "#{APP_PATH}/Gemfile"
|
27
|
-
end
|
28
|
-
|
29
|
-
before_fork do |server, worker|
|
30
|
-
defined?(ActiveRecord::Base) && ActiveRecord::Base.connection.disconnect!
|
31
|
-
|
32
|
-
if File.exists?(old_pid) && server.pid != old_pid
|
33
|
-
begin
|
34
|
-
#sig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOU
|
35
|
-
Process.kill("QUIT", File.read(old_pid).to_i)
|
36
|
-
rescue Errno::ENOENT, Errno::ESRCH
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
after_fork do |server, worker|
|
42
|
-
defined?(ActiveRecord::Base) && ActiveRecord::Base.establish_connection
|
43
|
-
end
|