Sha256: 0a9bdfaec9657d6e3c79cbb670909ef86d4e4efa92512af981dcb60580a0cc29

Contents?: true

Size: 1.12 KB

Versions: 3

Compression:

Stored size: 1.12 KB

Contents

#!/usr/bin/env puma

directory '<%= current_path %>'
rackup "<%=fetch(:puma_rackup)%>"
environment '<%= fetch(:puma_env) %>'
<% if fetch(:puma_tag) %>
tag '<%= fetch(:puma_tag)%>'
<% end %>
pidfile "<%=fetch(:puma_pid)%>"
state_path "<%=fetch(:puma_state)%>"


threads <%=fetch(:puma_threads).join(',')%>

<%= puma_plugins %>

<%= puma_bind %>
<% if fetch(:puma_control_app) %>
activate_control_app "<%= fetch(:puma_default_control_app) %>"
<% end %>
workers <%= puma_workers %>
<% if fetch(:puma_worker_timeout) %>
worker_timeout <%= fetch(:puma_worker_timeout).to_i %>
<% end %>

<% if puma_daemonize? %>
daemonize
<% end %>

restart_command '<%= fetch(:puma_restart_command) %>'

<% if puma_preload_app? %>
preload_app!
<% else %>
prune_bundler
<% end %>

on_restart do
  puts 'Refreshing Gemfile'
  ENV["BUNDLE_GEMFILE"] = "<%= fetch(:bundle_gemfile, "#{current_path}/Gemfile") %>"
end

<% if puma_preload_app? and fetch(:puma_init_active_record) %>
before_fork do
  ActiveRecord::Base.connection_pool.disconnect!
end

on_worker_boot do
  ActiveSupport.on_load(:active_record) do
    ActiveRecord::Base.establish_connection
  end
end
<% end %>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
capistrano-cookbook-5.0.2 lib/generators/capistrano/reliably_deploying_rails/templates/puma.rb.erb
capistrano-cookbook-5.0.1 lib/generators/capistrano/reliably_deploying_rails/templates/puma.rb.erb
capistrano-cookbook-5.0.0 lib/generators/capistrano/reliably_deploying_rails/templates/puma.rb.erb