Module: Luban::Deployment::Applications::Rack::WebServers::Puma::Common
- Defined in:
- lib/luban/deployment/applications/rack/web_servers/puma.rb
Instance Method Summary collapse
- #control_socket_file_name ⇒ Object
- #control_socket_file_path ⇒ Object
- #default_web_server_options ⇒ Object
- #error_log_file_path ⇒ Object
- #process_pattern ⇒ Object
- #puma_command ⇒ Object
- #service_entry ⇒ Object
- #start_command ⇒ Object
- #state_file_name ⇒ Object
- #state_file_path ⇒ Object
- #stop_command ⇒ Object
- #tcp_socket? ⇒ Boolean
- #unix_socket? ⇒ Boolean
Instance Method Details
#control_socket_file_name ⇒ Object
55 56 57 |
# File 'lib/luban/deployment/applications/rack/web_servers/puma.rb', line 55 def control_socket_file_name @control_socket_file_name ||= "#{current_web_server}ctl.sock" end |
#control_socket_file_path ⇒ Object
51 52 53 |
# File 'lib/luban/deployment/applications/rack/web_servers/puma.rb', line 51 def control_socket_file_path @control_socket_file_path ||= sockets_path.join(control_socket_file_name) end |
#default_web_server_options ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/luban/deployment/applications/rack/web_servers/puma.rb', line 8 def @default_web_server_options ||= { # Server options address: "127.0.0.1", port: port + 1, socket: socket_file_path.to_s, directory: release_path.to_s, environment: stage, # Daemon options daemonize: true, pidfile: pid_file_path.to_s, state_path: state_file_path.to_s, redirect_stdout: log_file_path.to_s, redirect_stderr: error_log_file_path.to_s, redirect_append: true, quiet: false, tag: "#{env_name}:#{release_tag}", # Cluster options servers: 2, threads: "1:1", preload: false, prune_bundler: true, # Control app options control_socket: control_socket_file_path.to_s, control_opts: { auth_token: port.to_s } } end |
#error_log_file_path ⇒ Object
47 48 49 |
# File 'lib/luban/deployment/applications/rack/web_servers/puma.rb', line 47 def error_log_file_path @error_log_file_path ||= log_path.join("#{current_web_server}_error.log") end |
#process_pattern ⇒ Object
71 72 73 |
# File 'lib/luban/deployment/applications/rack/web_servers/puma.rb', line 71 def process_pattern @process_pattern ||= "^puma .+\\[#{Regexp.escape(env_name)}:.*\\]" end |
#puma_command ⇒ Object
59 60 61 |
# File 'lib/luban/deployment/applications/rack/web_servers/puma.rb', line 59 def puma_command @puma_command ||= "pumactl -F #{control_file_path}" end |
#service_entry ⇒ Object
75 76 77 |
# File 'lib/luban/deployment/applications/rack/web_servers/puma.rb', line 75 def service_entry @serivce_entry ||= "#{super}.#{current_web_server}" end |
#start_command ⇒ Object
63 64 65 |
# File 'lib/luban/deployment/applications/rack/web_servers/puma.rb', line 63 def start_command @start_command ||= bundle_command("#{puma_command} start") end |
#state_file_name ⇒ Object
43 44 45 |
# File 'lib/luban/deployment/applications/rack/web_servers/puma.rb', line 43 def state_file_name @state_file_name ||= "#{current_web_server}.state" end |
#state_file_path ⇒ Object
39 40 41 |
# File 'lib/luban/deployment/applications/rack/web_servers/puma.rb', line 39 def state_file_path @state_file_path ||= pids_path.join(state_file_name) end |
#stop_command ⇒ Object
67 68 69 |
# File 'lib/luban/deployment/applications/rack/web_servers/puma.rb', line 67 def stop_command @stop_command ||= bundle_command("#{puma_command} stop") end |
#tcp_socket? ⇒ Boolean
36 |
# File 'lib/luban/deployment/applications/rack/web_servers/puma.rb', line 36 def tcp_socket?; @tcp_socket; end |
#unix_socket? ⇒ Boolean
37 |
# File 'lib/luban/deployment/applications/rack/web_servers/puma.rb', line 37 def unix_socket?; @unix_socket; end |