luban-rack 0.2.16 → 0.2.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/luban/deployment/applications/rack/publisher.rb +7 -0
- data/lib/luban/deployment/applications/rack/templates/puma/puma.rb.erb +3 -1
- data/lib/luban/deployment/applications/rack/version.rb +1 -1
- data/lib/luban/deployment/applications/rack/web_server.rb +2 -0
- data/lib/luban/deployment/applications/rack/web_servers/puma/plugin/luban.rb +24 -0
- data/lib/luban/deployment/applications/rack/web_servers/puma.rb +20 -3
- data/luban-rack.gemspec +0 -2
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 626db6c7b396d14e293e920efe56d3425761ef82
|
4
|
+
data.tar.gz: a62a72eeb89fd03d1ba6db97d538423fde5ca2e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 170aa8e0fabb3e51061e634011210820a4e422a6d0d613662991e175f726867e743fc9564629510699907423822986fb6f9d91994d02d4f6ae01f23fe99d0607
|
7
|
+
data.tar.gz: b86ae5dc78705ec32a35d50f1f9eee07ccde33c170d80482f7f376cdca0fd0f823c555a78c9444c20daf2ec3eb1e11b15e08e48b31a3f7da3ed88abeb0942765
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Change log
|
2
2
|
|
3
|
+
## Version 0.2.17 (Nov 14, 2016)
|
4
|
+
|
5
|
+
Minor enhancements:
|
6
|
+
* Added publish callback for web server
|
7
|
+
* Added Puma plugin for Luban integration to
|
8
|
+
* Solved process tag unchanged during phase restart
|
9
|
+
* Loaded app from releast path directly instead of current_app_path
|
10
|
+
|
3
11
|
## Version 0.2.16 (Nov 09, 2016)
|
4
12
|
|
5
13
|
Bug fixes:
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# Backport :define_singleton_method
|
2
|
+
unless Kernel.method_defined? :define_singleton_method
|
3
|
+
module Kernel
|
4
|
+
def define_singleton_method(*args, &block)
|
5
|
+
class << self
|
6
|
+
self
|
7
|
+
end.send(:define_method, *args, &block)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
Puma::Plugin.create do
|
13
|
+
def start(launcher)
|
14
|
+
launcher.define_singleton_method(:phased_restart) do
|
15
|
+
init_options = { config_files: @options.all_of(:config_files) }
|
16
|
+
@options.instance_variable_set(:@cur, init_options)
|
17
|
+
@options.instance_variable_set(:@set, [init_options])
|
18
|
+
@config.load
|
19
|
+
@restart_dir = dir if dir = @options[:directory]
|
20
|
+
set_process_title
|
21
|
+
super()
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -11,8 +11,7 @@ module Luban
|
|
11
11
|
address: "127.0.0.1",
|
12
12
|
port: port + 1,
|
13
13
|
socket: socket_file_path.to_s,
|
14
|
-
|
15
|
-
directory: current_app_path.to_s,
|
14
|
+
directory: release_path.to_s,
|
16
15
|
environment: stage,
|
17
16
|
# Daemon options
|
18
17
|
daemonize: true,
|
@@ -30,7 +29,7 @@ module Luban
|
|
30
29
|
prune_bundler: true,
|
31
30
|
# Control app options
|
32
31
|
control_socket: control_socket_file_path.to_s,
|
33
|
-
control_opts: {
|
32
|
+
control_opts: { auth_token: port.to_s }
|
34
33
|
}
|
35
34
|
end
|
36
35
|
|
@@ -150,6 +149,24 @@ module Luban
|
|
150
149
|
def phased_restart_command
|
151
150
|
@phased_restart_command ||= bundle_command("#{puma_command} phased-restart")
|
152
151
|
end
|
152
|
+
|
153
|
+
def publish_web_server
|
154
|
+
install_puma_plugins if publish_app?
|
155
|
+
end
|
156
|
+
|
157
|
+
protected
|
158
|
+
|
159
|
+
def install_puma_plugins
|
160
|
+
src_plugin_path = Pathname.new(__FILE__).dirname.join('puma', 'plugin')
|
161
|
+
dst_plugin_path = within(release_path) do
|
162
|
+
Pathname.new(capture(bundle_executable, :show, 'puma'))
|
163
|
+
end.join('lib', 'puma', 'plugin')
|
164
|
+
Pathname.glob(src_plugin_path.join('*.rb')).each do |src_plugin|
|
165
|
+
dst_plugin = dst_plugin_path.join(src_plugin.basename)
|
166
|
+
upload_by_template(file_to_upload: dst_plugin, template_file: src_plugin,
|
167
|
+
auto_revision: true)
|
168
|
+
end
|
169
|
+
end
|
153
170
|
end
|
154
171
|
end
|
155
172
|
end
|
data/luban-rack.gemspec
CHANGED
@@ -15,8 +15,6 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
-
spec.bindir = "exe"
|
19
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
18
|
spec.require_paths = ["lib"]
|
21
19
|
|
22
20
|
spec.required_ruby_version = ">= 2.1.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: luban-rack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rubyist Chi
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: luban
|
@@ -100,6 +100,7 @@ files:
|
|
100
100
|
- lib/luban/deployment/applications/rack/version.rb
|
101
101
|
- lib/luban/deployment/applications/rack/web_server.rb
|
102
102
|
- lib/luban/deployment/applications/rack/web_servers/puma.rb
|
103
|
+
- lib/luban/deployment/applications/rack/web_servers/puma/plugin/luban.rb
|
103
104
|
- lib/luban/deployment/applications/rack/web_servers/thin.rb
|
104
105
|
- lib/luban/rack.rb
|
105
106
|
- luban-rack.gemspec
|