capistrano3-puma 6.1.0 → 7.0.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d2f07d6e635bd2c3dd87706742d9f417140165102818a2f05f7be0b9d4e031d
4
- data.tar.gz: ce613f7509c20d4520a599a0f93a9a6d5a0d485037c11aa94914fdca4c0fffcd
3
+ metadata.gz: e49b3136d5a3c5279003a9139c46ce543b0e313cba29cfe17a91f86e4d44b67b
4
+ data.tar.gz: 9659ae66cf2f6d0347411f6dedb79a2f8d616d0a5648e2fe0c306601d874cb0c
5
5
  SHA512:
6
- metadata.gz: c303ca5c2c0d1f28e288bffcb84ffe5ee69a708ad2c08bf000cc3f0004cdef369da1822b00b564d8c6c9e2ded34e54de7aa43a256e95384d6d7c29195a9538a1
7
- data.tar.gz: 6750f2ae9a2c356cf1e099b5ea2e1144a6fc843bd5b9828e2843a50b15977df4e5cdc43b98216dff0bc02e40661d6934bb5a519e85734edb3a334e0a7e76a437
6
+ metadata.gz: b8534f612b8bc2afb41266a1a7bf3a91671768a776b7dc0669057dec847f3bc1d1767cb17dd9da2c6624de7f0d98045012fce8c77f29634272938444a7cb0840
7
+ data.tar.gz: 1ae3fd5a9a4a3c5884388055e61c271fe97766dfce7e7372aa85567f50f899b6b00d905b7b1e867156786dc75cd4b4626e8ef58201b29c697bccc2fb33c2d8a5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## [6.2.0](https://github.com/seuros/capistrano-puma/tree/6.2.0) (2025-06-22)
4
+
5
+ [Full Changelog](https://github.com/seuros/capistrano-puma/compare/v6.1.0...6.2.0)
6
+ - Harmonized interface with capistrano-sidekiq for better ecosystem consistency
7
+ - Aligned configuration variable naming patterns
8
+ - Unified systemd command execution methods
9
+ - Standardized template search order across both gems
10
+ - Added documentation reference to example application
11
+
3
12
  ## [6.1.0](https://github.com/seuros/capistrano-puma/tree/6.1.0) (2025-01-21)
4
13
 
5
14
  [Full Changelog](https://github.com/seuros/capistrano-puma/compare/v6.0.0...6.1.0)
data/README.md CHANGED
@@ -1,6 +1,17 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/capistrano3-puma.svg)](http://badge.fury.io/rb/capistrano3-puma)
2
2
  # Capistrano::Puma
3
3
 
4
+ Puma integration for Capistrano - providing systemd service management and zero-downtime deployments for Puma 5.1+.
5
+
6
+ ## Example Application
7
+
8
+ For a complete working example of this gem in action, see the [capistrano-example-app](https://github.com/seuros/capistrano-example-app) which demonstrates:
9
+ - Rails 8.0 deployment with Capistrano
10
+ - Puma 6.0 with systemd socket activation
11
+ - Zero-downtime deployments
12
+ - rbenv integration
13
+ - Nginx configuration examples
14
+
4
15
  ## Installation
5
16
 
6
17
  Add this line to your application's Gemfile:
@@ -3,7 +3,7 @@ module Capistrano
3
3
  include PumaCommon
4
4
 
5
5
  def register_hooks
6
- after 'deploy:finished', 'puma:smart_restart'
6
+ after 'deploy:published', 'puma:smart_restart'
7
7
  end
8
8
 
9
9
  def define_tasks
@@ -26,10 +26,6 @@ module Capistrano
26
26
  set_if_empty :puma_service_templates_path, fetch(:service_templates_path, 'config/deploy/templates')
27
27
  end
28
28
 
29
- def expanded_bundle_command
30
- backend.capture(:echo, SSHKit.config.command_map[:bundle]).strip
31
- end
32
-
33
29
  def fetch_systemd_unit_path
34
30
  if fetch(:puma_systemctl_user) == :system
35
31
  "/etc/systemd/system/"
@@ -6,18 +6,18 @@ module Capistrano
6
6
  def puma_switch_user(role, &block)
7
7
  user = puma_user(role)
8
8
  if user == role.user
9
- block.call
9
+ yield
10
10
  else
11
- backend.as user do
12
- block.call
13
- end
11
+ backend.as(user, &block)
14
12
  end
15
13
  end
16
14
 
17
15
  def puma_user(role)
18
16
  properties = role.properties
17
+ return role.user unless properties
18
+
19
19
  properties.fetch(:puma_user) || # local property for puma only
20
- fetch(:puma_user) ||
20
+ fetch(:puma_user, nil) ||
21
21
  properties.fetch(:run_as) || # global property across multiple capistrano gems
22
22
  role.user
23
23
  end
@@ -31,10 +31,8 @@ module Capistrano
31
31
  def service_unit_type
32
32
  ## Jruby don't support notify
33
33
  return "simple" if RUBY_ENGINE == "jruby"
34
- fetch(:puma_service_unit_type,
35
- ## Check if sd_notify is available in the bundle
36
- Gem::Specification.find_all_by_name("sd_notify").any? ? "notify" : "simple")
37
-
34
+ ## Puma 6.1+ has built-in sd_notify support
35
+ fetch(:puma_service_unit_type, "notify")
38
36
  end
39
37
 
40
38
  def compiled_template_puma(from, role)
@@ -53,11 +51,7 @@ module Capistrano
53
51
  File.expand_path("../templates/#{from}.rb.erb", __FILE__)
54
52
  ].detect { |path| File.file?(path) }
55
53
  erb = File.read(file)
56
- if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.6')
57
- StringIO.new(ERB.new(erb, nil, '-').result(binding))
58
- else
59
- StringIO.new(ERB.new(erb, trim_mode: '-').result(binding))
60
- end
54
+ StringIO.new(ERB.new(erb, trim_mode: '-').result(binding))
61
55
  end
62
56
 
63
57
  def template_puma(from, to, role)
@@ -102,6 +96,10 @@ module Capistrano
102
96
  PumaBind.new(m, etype.to_sym, address)
103
97
  end
104
98
  end
99
+
100
+ def expanded_bundle_command
101
+ backend.capture(:echo, SSHKit.config.command_map[:bundle]).strip
102
+ end
105
103
  end
106
104
 
107
105
  class Puma < Capistrano::Plugin
@@ -109,10 +107,10 @@ module Capistrano
109
107
 
110
108
  def set_defaults
111
109
  set_if_empty :puma_role, :web
112
- set_if_empty :puma_env, -> { fetch(:rack_env, fetch(:rails_env, fetch(:stage))) }
110
+ set_if_empty :puma_env, -> { fetch(:rack_env, fetch(:rails_env, fetch(:rake_env, fetch(:stage)))) }
113
111
  set_if_empty :puma_bind, -> { "unix://#{File.join(shared_path, 'tmp', 'sockets', 'puma.sock')}" }
114
112
  set_if_empty :puma_access_log, -> { File.join(shared_path, 'log', "puma.log") }
115
- set_if_empty :puma_error_log, -> { File.join(shared_path, 'log', "puma.log") }
113
+ set_if_empty :puma_error_log, -> { File.join(shared_path, 'log', "puma_error.log") }
116
114
 
117
115
  # Chruby, Rbenv and RVM integration
118
116
  append :chruby_map_bins, 'puma', 'pumactl' if fetch(:chruby_map_bins)
@@ -21,7 +21,11 @@ WatchdogSec=<%= fetch(:puma_systemd_watchdog_sec) %>
21
21
  <% end %>
22
22
  <%="User=#{puma_user(@role)}" if fetch(:puma_systemctl_user) == :system %>
23
23
  WorkingDirectory=<%= current_path %>
24
+ <% if fetch(:puma_use_login_shell) %>
25
+ ExecStart=/bin/bash -lc '<%= expanded_bundle_command %> exec puma -e <%= fetch(:puma_env) %>'
26
+ <% else %>
24
27
  ExecStart=<%= expanded_bundle_command %> exec puma -e <%= fetch(:puma_env) %>
28
+ <% end %>
25
29
  ExecReload=/bin/kill -USR1 $MAINPID
26
30
  <%- Array(fetch(:puma_service_unit_env_files)).each do |file| %>
27
31
  <%="EnvironmentFile=#{file}" -%>
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano3-puma
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.0
4
+ version: 7.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abdelkader Boudih
8
+ autorequire:
8
9
  bindir: bin
9
10
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
11
+ date: 2025-09-23 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: capistrano
@@ -43,20 +44,20 @@ dependencies:
43
44
  requirements:
44
45
  - - ">="
45
46
  - !ruby/object:Gem::Version
46
- version: '5.1'
47
+ version: '6.1'
47
48
  - - "<"
48
49
  - !ruby/object:Gem::Version
49
- version: '7.0'
50
+ version: '8.0'
50
51
  type: :runtime
51
52
  prerelease: false
52
53
  version_requirements: !ruby/object:Gem::Requirement
53
54
  requirements:
54
55
  - - ">="
55
56
  - !ruby/object:Gem::Version
56
- version: '5.1'
57
+ version: '6.1'
57
58
  - - "<"
58
59
  - !ruby/object:Gem::Version
59
- version: '7.0'
60
+ version: '8.0'
60
61
  description: Puma integration for Capistrano 3
61
62
  email:
62
63
  - Terminale@gmail.com
@@ -82,8 +83,7 @@ homepage: https://github.com/seuros/capistrano-puma
82
83
  licenses:
83
84
  - MIT
84
85
  metadata: {}
85
- post_install_message: "\n Version 6.0.0 is a major release. Please see README.md,
86
- breaking changes are listed in CHANGELOG.md\n "
86
+ post_install_message:
87
87
  rdoc_options: []
88
88
  require_paths:
89
89
  - lib
@@ -91,14 +91,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
91
91
  requirements:
92
92
  - - ">="
93
93
  - !ruby/object:Gem::Version
94
- version: '2.5'
94
+ version: '2.4'
95
95
  required_rubygems_version: !ruby/object:Gem::Requirement
96
96
  requirements:
97
97
  - - ">="
98
98
  - !ruby/object:Gem::Version
99
99
  version: '0'
100
100
  requirements: []
101
- rubygems_version: 3.6.7
101
+ rubygems_version: 3.0.3.1
102
+ signing_key:
102
103
  specification_version: 4
103
104
  summary: Puma integration for Capistrano
104
105
  test_files: []