capper 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/capper.gemspec +1 -1
- data/lib/capper/templates/unicorn.rb.erb +1 -1
- data/lib/capper/unicorn.rb +2 -2
- data/lib/capper/utils/templates.rb +7 -11
- metadata +53 -61
data/Gemfile.lock
CHANGED
data/capper.gemspec
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
# Use at least one worker per core if you're on a dedicated server,
|
8
8
|
# more will usually help for _short_ waits on databases/caches.
|
9
|
-
worker_processes <%=
|
9
|
+
worker_processes <%= unicorn_worker_processes %>
|
10
10
|
|
11
11
|
# Help ensure your application will always spawn in the symlinked
|
12
12
|
# "current" directory that Capistrano sets up.
|
data/lib/capper/unicorn.rb
CHANGED
@@ -37,9 +37,9 @@ Capper.load do
|
|
37
37
|
desc "Generate unicorn configuration files"
|
38
38
|
task :setup, :roles => :app, :except => { :no_release => true } do
|
39
39
|
upload_template("unicorn.rb", unicorn_config,
|
40
|
-
:mode => "0644"
|
40
|
+
:mode => "0644")
|
41
41
|
upload_template("unicorn.sh", unicorn_script,
|
42
|
-
:mode => "0755"
|
42
|
+
:mode => "0755")
|
43
43
|
end
|
44
44
|
|
45
45
|
desc "Kill unicorn (this should only be used if all else fails)"
|
@@ -15,7 +15,6 @@ class Capper
|
|
15
15
|
end
|
16
16
|
|
17
17
|
erb = Erubis::Eruby.new(File.open(template).read)
|
18
|
-
prefix = options.delete(:prefix)
|
19
18
|
|
20
19
|
if task = current_task
|
21
20
|
servers = find_servers_for_task(task, options)
|
@@ -28,7 +27,7 @@ class Capper
|
|
28
27
|
end
|
29
28
|
|
30
29
|
servers.each do |server|
|
31
|
-
result = erb.result(get_binding(
|
30
|
+
result = erb.result(get_binding(server.host))
|
32
31
|
put(result, path, options.merge!(:host => server.host))
|
33
32
|
end
|
34
33
|
end
|
@@ -39,19 +38,16 @@ class Capper
|
|
39
38
|
# "app1.example.com" => 4,
|
40
39
|
# "app2.example.com" => 8,
|
41
40
|
# }
|
42
|
-
def get_binding(
|
41
|
+
def get_binding(server)
|
43
42
|
b = binding()
|
44
43
|
|
45
|
-
variables.keys.
|
46
|
-
|
47
|
-
end.each do |k|
|
48
|
-
new_k = k.to_s.gsub(/^#{prefix}_/, '')
|
49
|
-
new_v = fetch(k)
|
44
|
+
variables.keys.each do |k|
|
45
|
+
v = fetch(k)
|
50
46
|
|
51
|
-
if
|
52
|
-
eval("set(:#{
|
47
|
+
if v.kind_of?(Hash)
|
48
|
+
eval("set(:#{k}, \"#{v[server] || v["default"]}\")", b)
|
53
49
|
else
|
54
|
-
eval("set(:#{
|
50
|
+
eval("set(:#{k}, \"#{v}\")", b)
|
55
51
|
end
|
56
52
|
end
|
57
53
|
|
metadata
CHANGED
@@ -1,73 +1,69 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: capper
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.1
|
4
5
|
prerelease:
|
5
|
-
version: 0.2.0
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
8
|
-
-
|
7
|
+
authors:
|
8
|
+
- Benedikt Böhm
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
dependencies:
|
16
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2011-07-29 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
17
15
|
name: erubis
|
18
|
-
|
19
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &11915860 !ruby/object:Gem::Requirement
|
20
17
|
none: false
|
21
|
-
requirements:
|
22
|
-
- -
|
23
|
-
- !ruby/object:Gem::Version
|
24
|
-
version:
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
25
22
|
type: :runtime
|
26
|
-
version_requirements: *id001
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: capistrano
|
29
23
|
prerelease: false
|
30
|
-
|
24
|
+
version_requirements: *11915860
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: capistrano
|
27
|
+
requirement: &11915420 !ruby/object:Gem::Requirement
|
31
28
|
none: false
|
32
|
-
requirements:
|
33
|
-
- -
|
34
|
-
- !ruby/object:Gem::Version
|
35
|
-
version:
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
36
33
|
type: :runtime
|
37
|
-
version_requirements: *id002
|
38
|
-
- !ruby/object:Gem::Dependency
|
39
|
-
name: capistrano_colors
|
40
34
|
prerelease: false
|
41
|
-
|
35
|
+
version_requirements: *11915420
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: capistrano_colors
|
38
|
+
requirement: &11915000 !ruby/object:Gem::Requirement
|
42
39
|
none: false
|
43
|
-
requirements:
|
44
|
-
- -
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version:
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
47
44
|
type: :runtime
|
48
|
-
version_requirements: *id003
|
49
|
-
- !ruby/object:Gem::Dependency
|
50
|
-
name: bundler
|
51
45
|
prerelease: false
|
52
|
-
|
46
|
+
version_requirements: *11915000
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: bundler
|
49
|
+
requirement: &11914500 !ruby/object:Gem::Requirement
|
53
50
|
none: false
|
54
|
-
requirements:
|
51
|
+
requirements:
|
55
52
|
- - ~>
|
56
|
-
- !ruby/object:Gem::Version
|
53
|
+
- !ruby/object:Gem::Version
|
57
54
|
version: 1.0.0
|
58
55
|
type: :development
|
59
|
-
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *11914500
|
60
58
|
description: Capistrano is a collection of opinionated Capistrano recipes
|
61
|
-
email:
|
59
|
+
email:
|
62
60
|
- bb@xnull.de
|
63
61
|
executables: []
|
64
|
-
|
65
62
|
extensions: []
|
66
|
-
|
67
|
-
extra_rdoc_files:
|
63
|
+
extra_rdoc_files:
|
68
64
|
- LICENSE
|
69
65
|
- README.md
|
70
|
-
files:
|
66
|
+
files:
|
71
67
|
- .document
|
72
68
|
- .gitignore
|
73
69
|
- .rvmrc
|
@@ -91,33 +87,29 @@ files:
|
|
91
87
|
- lib/capper/utils/multistage.rb
|
92
88
|
- lib/capper/utils/templates.rb
|
93
89
|
- lib/capper/whenever.rb
|
94
|
-
has_rdoc: true
|
95
90
|
homepage: http://github.com/hollow/capper
|
96
|
-
licenses:
|
91
|
+
licenses:
|
97
92
|
- MIT
|
98
93
|
post_install_message:
|
99
94
|
rdoc_options: []
|
100
|
-
|
101
|
-
require_paths:
|
95
|
+
require_paths:
|
102
96
|
- lib
|
103
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
97
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
104
98
|
none: false
|
105
|
-
requirements:
|
106
|
-
- -
|
107
|
-
- !ruby/object:Gem::Version
|
108
|
-
version:
|
109
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ! '>='
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0'
|
103
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
104
|
none: false
|
111
|
-
requirements:
|
112
|
-
- -
|
113
|
-
- !ruby/object:Gem::Version
|
114
|
-
version:
|
105
|
+
requirements:
|
106
|
+
- - ! '>='
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: '0'
|
115
109
|
requirements: []
|
116
|
-
|
117
110
|
rubyforge_project:
|
118
|
-
rubygems_version: 1.6
|
111
|
+
rubygems_version: 1.8.6
|
119
112
|
signing_key:
|
120
113
|
specification_version: 3
|
121
114
|
summary: Capistrano is a collection of opinionated Capistrano recipes
|
122
115
|
test_files: []
|
123
|
-
|