capistrano3-puma 5.0.3 → 5.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 73044aaf982d12bacb545460eec4a28a80735dfda025df5ee6a7b656f63185a1
4
- data.tar.gz: 768c19108f85c471feb7cfc341e04244af87c90ed91e59c13d44f7771269ca4a
3
+ metadata.gz: 98e0fb64cfd73c2183c8ac641ec0e426f1721657254eeae1b6cebea4d9b34e78
4
+ data.tar.gz: 658219686493acef08d13c050c6d3c8536c980a6820d3d1165dcb5c3e3c80f89
5
5
  SHA512:
6
- metadata.gz: 725fa2b8f4686d644a3068d872b46b17f3f1e3e772f3efb63bcec68affbc793dc3e037220bf3c27bad86a4c8c71f492d140b51e4f6388cbd741762c4461764b8
7
- data.tar.gz: '03186b58d6b3574bb67ebd393827704bb69f2bf90a60412ba16ae9067f4a1c91b8d5150f95143bb1525df78417ab9e3b372e8d129f11b56b2a9498446c71a15e'
6
+ metadata.gz: 2423e9acfe501fe4404592ae5099e619aa168e055372ea7e56762a001e59cbefbdf6d32373e7c003a6abe2fefcde429887bddb5d02d7806b8969fa92297d70ad
7
+ data.tar.gz: f629c899266cbc6a97b40243c1edfdfa7ba23e6f519f837e6c05209de2845261ca25a823a84ecbf1045fe8566845deff8fb71c7fee967e1c9b46d67896f9652b
@@ -0,0 +1,19 @@
1
+ name: Mark stale issues and pull requests
2
+
3
+ on:
4
+ schedule:
5
+ - cron: "30 1 * * *"
6
+
7
+ jobs:
8
+ stale:
9
+
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - uses: actions/stale@v3
14
+ with:
15
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
16
+ stale-issue-message: 'Stale issue message'
17
+ stale-pr-message: 'Stale pull request message'
18
+ stale-issue-label: 'no-issue-activity'
19
+ stale-pr-label: 'no-pr-activity'
data/CHANGELOG.md CHANGED
@@ -1,60 +1,321 @@
1
- ## Changelog
2
- - 5.0.3:
3
- - Remove ExecStop from systemd unit file (#314)
4
- - Systemd user service manager and lingering (#307)
5
- - 5.0.2:
6
- - Single name for systemd config template
7
- - 5.0.1:
8
- - Fix #301, Task "puma:smart_restart" not found
9
- - 5.0.0:
10
- - Support puma 5.0
11
- - Support SystemD service manager
12
- - 4.0.0:
13
- - Support puma 4.x
14
- - 3.1.0:
15
- - Don't load puma hooks by default.
16
- - 3.0.0:
17
- - Require capistrano 3.7+
18
- - Implement the plugin system
19
- - don't fail if puma was already running
20
- - Added :puma_daemonize option (default is false)
21
-
22
- - 2.0.0:
23
- - Require puma 3.4+
24
- - Require Capistrano 3.5+
25
- - Require capistrano-bundler
26
-
27
- - 1.2.0: add support for puma user for puma user @mcb & @seuros
28
- - 1.1.0: Set :puma_preload_app to false; Reload Monit after uploading any monit configuration; Always refresh Gemfile @rafaelgoulart @suhailpatel @sime
29
- - 1.0.0: Add activate control app @askagirl
30
- - 0.8.5: Fix smart_restart task to check if puma preloads app
31
- - 0.8.4: Allow patch method (Nginx template) @lonre
32
- - 0.8.2: Start task creates a conf file if none exists @stevemadere
33
- - 0.8.1: Fixed nginx task @hnatt, support for prune_bundler @behe
34
- - 0.8.0: Some changes
35
- - 0.7.0: added Nginx template generator @dfang
36
- - 0.6.1: added :puma_default_hooks, you can turn off the automatic hooks by setting it false
37
- - 0.6.0: Remove `daemonize true` from default puma.rb file. Explicitly pass `--daemon` flag when needed.
38
- - 0.5.1: Added worker_timeout option
39
- - 0.5.0: Bugs fixes
40
- - 0.4.2: Fix monit template to support chruby
41
- - 0.4.1: Fix puma jungle (debian)
42
- - 0.4.0: Multi-bind support
43
- - 0.3.7: Dependency bug fix
44
- - 0.3.5: Fixed a prehistoric bug
45
- - 0.3.4: I don't remember what i did here
46
- - 0.3.3: Puma jungle start fix
47
- - 0.3.2: Tag option support (require puma 2.8.2+)
48
- - 0.3.1: Typo fix
49
- - 0.3.0: Initial support for puma signals
50
- - 0.2.2: Application pre-loading is optional now (set puma_preload_app to false to turn it off)
51
- - 0.2.1: Tasks are run within rack context
52
- - 0.2.0: Support for puma `ActiveRecord::Base.establish_connection` on
53
- boot
54
- - 0.1.3: Capistrano 3.1 support
55
- - 0.1.2: Gemfile are refreshed between deploys now
56
- - 0.1.1: Initial support for Monit and configuration override added.
57
- - 0.1.0: Phased restart will be used if puma is in cluster mode
58
- - 0.0.9: puma.rb location changed to shared_path root. puma:check moved to after deploy:check
59
- - 0.0.8: puma.rb is automatically generated if not present. Fixed RVM issue.
60
- - 0.0.7: Gem pushed to rubygems as capistrano3-puma. Support of Redhat based OS for Jungle init script.
1
+ # Changelog
2
+
3
+ ## [5.2.0](https://github.com/seuros/capistrano-puma/tree/5.2.0) (2021-09-11)
4
+
5
+ [Full Changelog](https://github.com/seuros/capistrano-puma/compare/v5.1.1...5.2.0)
6
+
7
+ **Merged pull requests:**
8
+
9
+ - Add option for phased restart of puma [\#333](https://github.com/seuros/capistrano-puma/pull/333) ([phylor](https://github.com/phylor))
10
+
11
+ ## [v5.1.1](https://github.com/seuros/capistrano-puma/tree/v5.1.1) (2021-09-03)
12
+
13
+ [Full Changelog](https://github.com/seuros/capistrano-puma/compare/v5.1.0...v5.1.1)
14
+
15
+ **Merged pull requests:**
16
+
17
+ - Reload also should support system mode. [\#331](https://github.com/seuros/capistrano-puma/pull/331) ([Eric-Guo](https://github.com/Eric-Guo))
18
+
19
+ ## [v5.1.0](https://github.com/seuros/capistrano-puma/tree/v5.1.0) (2021-09-02)
20
+
21
+ [Full Changelog](https://github.com/seuros/capistrano-puma/compare/v5.0.4...v5.1.0)
22
+
23
+ **Merged pull requests:**
24
+
25
+ - Phased restart [\#329](https://github.com/seuros/capistrano-puma/pull/329) ([mksvdmtr](https://github.com/mksvdmtr))
26
+ - fix typo in README.md [\#325](https://github.com/seuros/capistrano-puma/pull/325) ([Yuki-Inoue](https://github.com/Yuki-Inoue))
27
+ - Implement puma systemd sockets [\#324](https://github.com/seuros/capistrano-puma/pull/324) ([chriscz](https://github.com/chriscz))
28
+
29
+ ## [v5.0.4](https://github.com/seuros/capistrano-puma/tree/v5.0.4) (2021-03-03)
30
+
31
+ [Full Changelog](https://github.com/seuros/capistrano-puma/compare/v5.0.3...v5.0.4)
32
+
33
+ **Merged pull requests:**
34
+
35
+ - fix: puma\_systemctl\_user default value [\#319](https://github.com/seuros/capistrano-puma/pull/319) ([davegudge](https://github.com/davegudge))
36
+
37
+ ## [v5.0.3](https://github.com/seuros/capistrano-puma/tree/v5.0.3) (2021-02-23)
38
+
39
+ [Full Changelog](https://github.com/seuros/capistrano-puma/compare/v5.0.2...v5.0.3)
40
+
41
+ **Merged pull requests:**
42
+
43
+ - update systemd template accept puma\_service\_unit\_env\_file and puma\_se… [\#315](https://github.com/seuros/capistrano-puma/pull/315) ([iscreen](https://github.com/iscreen))
44
+ - Remove ExecStop from systemd unit file [\#314](https://github.com/seuros/capistrano-puma/pull/314) ([w-leads](https://github.com/w-leads))
45
+ - Default systemd service name on multi-app host [\#309](https://github.com/seuros/capistrano-puma/pull/309) ([bendilley](https://github.com/bendilley))
46
+ - Systemd user service manager and lingering [\#307](https://github.com/seuros/capistrano-puma/pull/307) ([farnsworth](https://github.com/farnsworth))
47
+ - Update nginx template to support X-Forwarded-Proto and remove executables from \*.erb files [\#283](https://github.com/seuros/capistrano-puma/pull/283) ([dapi](https://github.com/dapi))
48
+
49
+ ## [v5.0.2](https://github.com/seuros/capistrano-puma/tree/v5.0.2) (2020-12-07)
50
+
51
+ [Full Changelog](https://github.com/seuros/capistrano-puma/compare/v5.0.1...v5.0.2)
52
+
53
+ **Merged pull requests:**
54
+
55
+ - Single name for systemd config template [\#308](https://github.com/seuros/capistrano-puma/pull/308) ([bendilley](https://github.com/bendilley))
56
+
57
+ ## [v5.0.1](https://github.com/seuros/capistrano-puma/tree/v5.0.1) (2020-12-02)
58
+
59
+ [Full Changelog](https://github.com/seuros/capistrano-puma/compare/v5.0.0...v5.0.1)
60
+
61
+ **Merged pull requests:**
62
+
63
+ - Fix \#301, Task "puma:smart\_restart" not found [\#304](https://github.com/seuros/capistrano-puma/pull/304) ([Eric-Guo](https://github.com/Eric-Guo))
64
+
65
+ ## [v5.0.0](https://github.com/seuros/capistrano-puma/tree/v5.0.0) (2020-12-01)
66
+
67
+ [Full Changelog](https://github.com/seuros/capistrano-puma/compare/v5.0.0.beta1...v5.0.0)
68
+
69
+ ## [v5.0.0.beta1](https://github.com/seuros/capistrano-puma/tree/v5.0.0.beta1) (2020-11-04)
70
+
71
+ [Full Changelog](https://github.com/seuros/capistrano-puma/compare/v4.0.0...v5.0.0.beta1)
72
+
73
+ **Merged pull requests:**
74
+
75
+ - Add systemd support and puma 5 support [\#300](https://github.com/seuros/capistrano-puma/pull/300) ([ayamomiji](https://github.com/ayamomiji))
76
+ - Update nginx template [\#290](https://github.com/seuros/capistrano-puma/pull/290) ([neolyte](https://github.com/neolyte))
77
+ - Improve already running warning message [\#262](https://github.com/seuros/capistrano-puma/pull/262) ([jackbot](https://github.com/jackbot))
78
+
79
+ ## [v4.0.0](https://github.com/seuros/capistrano-puma/tree/v4.0.0) (2019-06-27)
80
+
81
+ [Full Changelog](https://github.com/seuros/capistrano-puma/compare/v3.1.1...v4.0.0)
82
+
83
+ **Merged pull requests:**
84
+
85
+ - Change 3.4 to 4.0 [\#285](https://github.com/seuros/capistrano-puma/pull/285) ([paulomcnally](https://github.com/paulomcnally))
86
+ - Revert "Fixed call parameter" [\#282](https://github.com/seuros/capistrano-puma/pull/282) ([stefanwild](https://github.com/stefanwild))
87
+ - Fixed call parameter [\#280](https://github.com/seuros/capistrano-puma/pull/280) ([stefanwild](https://github.com/stefanwild))
88
+ - Use HTTP 1.1 for proxying [\#277](https://github.com/seuros/capistrano-puma/pull/277) ([amiuhle](https://github.com/amiuhle))
89
+ - Update README.md [\#276](https://github.com/seuros/capistrano-puma/pull/276) ([poyzn](https://github.com/poyzn))
90
+ - fix typo in readme [\#275](https://github.com/seuros/capistrano-puma/pull/275) ([knt45](https://github.com/knt45))
91
+ - special case: setting X-Forwarded-Proto https even if ngnix is not using SSL [\#265](https://github.com/seuros/capistrano-puma/pull/265) ([anand-c-srinivasan](https://github.com/anand-c-srinivasan))
92
+ - \#243 Fix restart task, pumactl don't call bundle exec on restart [\#251](https://github.com/seuros/capistrano-puma/pull/251) ([pgericson](https://github.com/pgericson))
93
+ - Wrong path to puma config fixed [\#249](https://github.com/seuros/capistrano-puma/pull/249) ([atilla777](https://github.com/atilla777))
94
+ - Update README.md [\#247](https://github.com/seuros/capistrano-puma/pull/247) ([lozhn](https://github.com/lozhn))
95
+ - Added shared puma conf as argument to jungle:add [\#238](https://github.com/seuros/capistrano-puma/pull/238) ([anonoz](https://github.com/anonoz))
96
+
97
+ ## [v3.1.1](https://github.com/seuros/capistrano-puma/tree/v3.1.1) (2017-07-04)
98
+
99
+ [Full Changelog](https://github.com/seuros/capistrano-puma/compare/v3.1.0...v3.1.1)
100
+
101
+ **Merged pull requests:**
102
+
103
+ - Fix jungle setup for debian [\#235](https://github.com/seuros/capistrano-puma/pull/235) ([PavelBezpalov](https://github.com/PavelBezpalov))
104
+ - Force SSL/LTS with return directive [\#234](https://github.com/seuros/capistrano-puma/pull/234) ([notapatch](https://github.com/notapatch))
105
+ - Use `$host` to prevent forgery [\#232](https://github.com/seuros/capistrano-puma/pull/232) ([teeceepee](https://github.com/teeceepee))
106
+ - Fix undefined method 'as' on Capistrano::Puma and 'execute' should be wrapped in an 'on' block [\#230](https://github.com/seuros/capistrano-puma/pull/230) ([4xposed](https://github.com/4xposed))
107
+ - Wait for Monit to be reloaded [\#224](https://github.com/seuros/capistrano-puma/pull/224) ([ivanovaleksey](https://github.com/ivanovaleksey))
108
+ - Update README.md [\#223](https://github.com/seuros/capistrano-puma/pull/223) ([notapatch](https://github.com/notapatch))
109
+ - \[Fix \#219\] Call execute on backend [\#222](https://github.com/seuros/capistrano-puma/pull/222) ([ivanovaleksey](https://github.com/ivanovaleksey))
110
+ - Add option to specify the location of SSL certificates [\#221](https://github.com/seuros/capistrano-puma/pull/221) ([wynksaiddestroy](https://github.com/wynksaiddestroy))
111
+ - Fix the nginx\_conf can not upgrade to web sockets when using ActionCable [\#218](https://github.com/seuros/capistrano-puma/pull/218) ([Eric-Guo](https://github.com/Eric-Guo))
112
+ - Add stage to cap commands [\#216](https://github.com/seuros/capistrano-puma/pull/216) ([wynksaiddestroy](https://github.com/wynksaiddestroy))
113
+
114
+ ## [v3.1.0](https://github.com/seuros/capistrano-puma/tree/v3.1.0) (2017-03-24)
115
+
116
+ [Full Changelog](https://github.com/seuros/capistrano-puma/compare/v3.0.3...v3.1.0)
117
+
118
+ **Merged pull requests:**
119
+
120
+ - release 3.1.0 [\#212](https://github.com/seuros/capistrano-puma/pull/212) ([seuros](https://github.com/seuros))
121
+ - Minor fixes [\#211](https://github.com/seuros/capistrano-puma/pull/211) ([rojosinalma](https://github.com/rojosinalma))
122
+ - Fixes issue \#208 [\#209](https://github.com/seuros/capistrano-puma/pull/209) ([rojosinalma](https://github.com/rojosinalma))
123
+ - Give hint about appending variable values instead of setting them [\#207](https://github.com/seuros/capistrano-puma/pull/207) ([mcelicalderon](https://github.com/mcelicalderon))
124
+
125
+ ## [v3.0.3](https://github.com/seuros/capistrano-puma/tree/v3.0.3) (2017-03-23)
126
+
127
+ [Full Changelog](https://github.com/seuros/capistrano-puma/compare/v3.0.2...v3.0.3)
128
+
129
+ ## [v3.0.2](https://github.com/seuros/capistrano-puma/tree/v3.0.2) (2017-03-22)
130
+
131
+ [Full Changelog](https://github.com/seuros/capistrano-puma/compare/v3.0.1...v3.0.2)
132
+
133
+ **Merged pull requests:**
134
+
135
+ - Fix vars loading issue during plugin initialization [\#205](https://github.com/seuros/capistrano-puma/pull/205) ([ilyapoz](https://github.com/ilyapoz))
136
+
137
+ ## [v3.0.1](https://github.com/seuros/capistrano-puma/tree/v3.0.1) (2017-03-20)
138
+
139
+ [Full Changelog](https://github.com/seuros/capistrano-puma/compare/v3.0.0...v3.0.1)
140
+
141
+ ## [v3.0.0](https://github.com/seuros/capistrano-puma/tree/v3.0.0) (2017-03-18)
142
+
143
+ [Full Changelog](https://github.com/seuros/capistrano-puma/compare/v2.0.0...v3.0.0)
144
+
145
+ **Merged pull requests:**
146
+
147
+ - Release v3.0.0 candidate [\#201](https://github.com/seuros/capistrano-puma/pull/201) ([seuros](https://github.com/seuros))
148
+ - Add 'daemonize' config [\#194](https://github.com/seuros/capistrano-puma/pull/194) ([rhannequin](https://github.com/rhannequin))
149
+
150
+ ## [v2.0.0](https://github.com/seuros/capistrano-puma/tree/v2.0.0) (2017-03-08)
151
+
152
+ [Full Changelog](https://github.com/seuros/capistrano-puma/compare/v1.2.1...v2.0.0)
153
+
154
+ **Merged pull requests:**
155
+
156
+ - Skip puma start command if puma is running [\#198](https://github.com/seuros/capistrano-puma/pull/198) ([mizukmb](https://github.com/mizukmb))
157
+ - Fix puma:monit task for first deployment [\#187](https://github.com/seuros/capistrano-puma/pull/187) ([lucasalves](https://github.com/lucasalves))
158
+ - Update workers.rake [\#186](https://github.com/seuros/capistrano-puma/pull/186) ([treenewbee](https://github.com/treenewbee))
159
+ - typo [\#178](https://github.com/seuros/capistrano-puma/pull/178) ([BenjaminKim](https://github.com/BenjaminKim))
160
+ - Modify README file [\#176](https://github.com/seuros/capistrano-puma/pull/176) ([00dav00](https://github.com/00dav00))
161
+ - Remove trailing lines in ERB files [\#171](https://github.com/seuros/capistrano-puma/pull/171) ([papilip](https://github.com/papilip))
162
+ - Closing ActiveRecord connections before forking [\#170](https://github.com/seuros/capistrano-puma/pull/170) ([marcoschicote](https://github.com/marcoschicote))
163
+ - Add support to plugins [\#168](https://github.com/seuros/capistrano-puma/pull/168) ([seuros](https://github.com/seuros))
164
+ - Add server\_name to the http-\>https redirection server block [\#147](https://github.com/seuros/capistrano-puma/pull/147) ([bdewater](https://github.com/bdewater))
165
+ - Fix README: default value of puma\_preload\_app is false [\#145](https://github.com/seuros/capistrano-puma/pull/145) ([snoozer05](https://github.com/snoozer05))
166
+ - Respect the global puma\_user setting [\#139](https://github.com/seuros/capistrano-puma/pull/139) ([jhollinger](https://github.com/jhollinger))
167
+ - Add puma commands to chruby\_map\_bins. [\#135](https://github.com/seuros/capistrano-puma/pull/135) ([linjunpop](https://github.com/linjunpop))
168
+ - Run the shell as a login shell. [\#132](https://github.com/seuros/capistrano-puma/pull/132) ([kgiszczak](https://github.com/kgiszczak))
169
+ - Issue \#120 -- explicitly pass the config file location to pumactl [\#129](https://github.com/seuros/capistrano-puma/pull/129) ([lhagemann](https://github.com/lhagemann))
170
+ - Use SSHKit command\_map [\#128](https://github.com/seuros/capistrano-puma/pull/128) ([hbin](https://github.com/hbin))
171
+ - Update Readme [\#127](https://github.com/seuros/capistrano-puma/pull/127) ([h0lyalg0rithm](https://github.com/h0lyalg0rithm))
172
+
173
+ ## [v1.2.1](https://github.com/seuros/capistrano-puma/tree/v1.2.1) (2015-08-20)
174
+
175
+ [Full Changelog](https://github.com/seuros/capistrano-puma/compare/v1.2.0...v1.2.1)
176
+
177
+ **Merged pull requests:**
178
+
179
+ - Added fix for wrong arguments on puma stop [\#124](https://github.com/seuros/capistrano-puma/pull/124) ([rsov](https://github.com/rsov))
180
+
181
+ ## [v1.2.0](https://github.com/seuros/capistrano-puma/tree/v1.2.0) (2015-08-19)
182
+
183
+ [Full Changelog](https://github.com/seuros/capistrano-puma/compare/v1.1.0...v1.2.0)
184
+
185
+ **Implemented enhancements:**
186
+
187
+ - Adds ssl configuration for nginx [\#116](https://github.com/seuros/capistrano-puma/pull/116) ([mdesanti](https://github.com/mdesanti))
188
+
189
+ **Merged pull requests:**
190
+
191
+ - new puma user log [\#122](https://github.com/seuros/capistrano-puma/pull/122) ([seuros](https://github.com/seuros))
192
+ - Don't need establish connection block if `puma\_preload\_app' set to false [\#118](https://github.com/seuros/capistrano-puma/pull/118) ([hbin](https://github.com/hbin))
193
+ - Mcb/add support for puma user [\#117](https://github.com/seuros/capistrano-puma/pull/117) ([mcb](https://github.com/mcb))
194
+ - Fix puma\_monit\_bin [\#114](https://github.com/seuros/capistrano-puma/pull/114) ([msbrigna](https://github.com/msbrigna))
195
+ - Update monit tasks [\#113](https://github.com/seuros/capistrano-puma/pull/113) ([soylent](https://github.com/soylent))
196
+
197
+ ## [v1.1.0](https://github.com/seuros/capistrano-puma/tree/v1.1.0) (2015-06-23)
198
+
199
+ [Full Changelog](https://github.com/seuros/capistrano-puma/compare/v1.0.0...v1.1.0)
200
+
201
+ **Merged pull requests:**
202
+
203
+ - Always refresh Gemfile. Fixes \#109 [\#110](https://github.com/seuros/capistrano-puma/pull/110) ([sime](https://github.com/sime))
204
+ - Reload Monit after uploading any monit configuration [\#108](https://github.com/seuros/capistrano-puma/pull/108) ([suhailpatel](https://github.com/suhailpatel))
205
+ - Set :puma\_preload\_app to false [\#104](https://github.com/seuros/capistrano-puma/pull/104) ([rafaelgoulart](https://github.com/rafaelgoulart))
206
+
207
+ ## [v1.0.0](https://github.com/seuros/capistrano-puma/tree/v1.0.0) (2015-05-05)
208
+
209
+ [Full Changelog](https://github.com/seuros/capistrano-puma/compare/v0.9.0...v1.0.0)
210
+
211
+ **Merged pull requests:**
212
+
213
+ - Feature/add activate control app [\#103](https://github.com/seuros/capistrano-puma/pull/103) ([askagirl](https://github.com/askagirl))
214
+ - Missing 'r' in prune\_bundler [\#101](https://github.com/seuros/capistrano-puma/pull/101) ([sime](https://github.com/sime))
215
+
216
+ ## [v0.9.0](https://github.com/seuros/capistrano-puma/tree/v0.9.0) (2015-03-20)
217
+
218
+ [Full Changelog](https://github.com/seuros/capistrano-puma/compare/v0.8.5...v0.9.0)
219
+
220
+ **Merged pull requests:**
221
+
222
+ - Update Typo in README [\#97](https://github.com/seuros/capistrano-puma/pull/97) ([kcollignon](https://github.com/kcollignon))
223
+ - bundler prune should be automatically detect [\#96](https://github.com/seuros/capistrano-puma/pull/96) ([crhan](https://github.com/crhan))
224
+
225
+ ## [v0.8.5](https://github.com/seuros/capistrano-puma/tree/v0.8.5) (2015-01-30)
226
+
227
+ [Full Changelog](https://github.com/seuros/capistrano-puma/compare/v0.8.4...v0.8.5)
228
+
229
+ **Merged pull requests:**
230
+
231
+ - Fix smart\_restart task to check if puma preloads app [\#93](https://github.com/seuros/capistrano-puma/pull/93) ([sponomarev](https://github.com/sponomarev))
232
+
233
+ ## [v0.8.4](https://github.com/seuros/capistrano-puma/tree/v0.8.4) (2015-01-25)
234
+
235
+ [Full Changelog](https://github.com/seuros/capistrano-puma/compare/v0.8.3...v0.8.4)
236
+
237
+ **Merged pull requests:**
238
+
239
+ - Allow PATCH method [\#91](https://github.com/seuros/capistrano-puma/pull/91) ([lonre](https://github.com/lonre))
240
+ - Allow unix:/foo/ socket URLs [\#90](https://github.com/seuros/capistrano-puma/pull/90) ([indirect](https://github.com/indirect))
241
+ - Fix puma:monit task descriptions [\#88](https://github.com/seuros/capistrano-puma/pull/88) ([jc00ke](https://github.com/jc00ke))
242
+ - Convert to spaces [\#85](https://github.com/seuros/capistrano-puma/pull/85) ([lonre](https://github.com/lonre))
243
+ - Minor documentation correction [\#84](https://github.com/seuros/capistrano-puma/pull/84) ([neilbartley](https://github.com/neilbartley))
244
+ - appending :stage to puma's monit [\#81](https://github.com/seuros/capistrano-puma/pull/81) ([itsNikolay](https://github.com/itsNikolay))
245
+
246
+ ## [v0.8.3](https://github.com/seuros/capistrano-puma/tree/v0.8.3) (2014-10-28)
247
+
248
+ [Full Changelog](https://github.com/seuros/capistrano-puma/compare/v0.8.2...v0.8.3)
249
+
250
+ ## [v0.8.2](https://github.com/seuros/capistrano-puma/tree/v0.8.2) (2014-10-17)
251
+
252
+ [Full Changelog](https://github.com/seuros/capistrano-puma/compare/v0.8.1...v0.8.2)
253
+
254
+ **Merged pull requests:**
255
+
256
+ - Start task creates a conf file if none exists. [\#74](https://github.com/seuros/capistrano-puma/pull/74) ([stevemadere](https://github.com/stevemadere))
257
+
258
+ ## [v0.8.1](https://github.com/seuros/capistrano-puma/tree/v0.8.1) (2014-10-08)
259
+
260
+ [Full Changelog](https://github.com/seuros/capistrano-puma/compare/v0.8.0...v0.8.1)
261
+
262
+ **Merged pull requests:**
263
+
264
+ - Fix nginx config task work with roles [\#72](https://github.com/seuros/capistrano-puma/pull/72) ([hnatt](https://github.com/hnatt))
265
+ - Fix puma\_bind unix socket path [\#70](https://github.com/seuros/capistrano-puma/pull/70) ([hnatt](https://github.com/hnatt))
266
+ - Update nginx\_config task call example in README [\#69](https://github.com/seuros/capistrano-puma/pull/69) ([hnatt](https://github.com/hnatt))
267
+ - Added config option for prune\_bundler [\#68](https://github.com/seuros/capistrano-puma/pull/68) ([behe](https://github.com/behe))
268
+
269
+ ## [v0.8.0](https://github.com/seuros/capistrano-puma/tree/v0.8.0) (2014-09-23)
270
+
271
+ [Full Changelog](https://github.com/seuros/capistrano-puma/compare/v0.7.0...v0.8.0)
272
+
273
+ **Merged pull requests:**
274
+
275
+ - Update puma.cap to add missing , [\#65](https://github.com/seuros/capistrano-puma/pull/65) ([bryanl](https://github.com/bryanl))
276
+ - Fixed handling of multiple puma endpoints and of wildcard IP addresses [\#64](https://github.com/seuros/capistrano-puma/pull/64) ([jabbrwcky](https://github.com/jabbrwcky))
277
+ - Cannot call nginx:config cap task [\#61](https://github.com/seuros/capistrano-puma/pull/61) ([isc](https://github.com/isc))
278
+
279
+ ## [v0.7.0](https://github.com/seuros/capistrano-puma/tree/v0.7.0) (2014-08-07)
280
+
281
+ [Full Changelog](https://github.com/seuros/capistrano-puma/compare/v0.6.1...v0.7.0)
282
+
283
+ **Merged pull requests:**
284
+
285
+ - Add a task for uploading nginx site config and a generator for configuring template before uploadinging [\#57](https://github.com/seuros/capistrano-puma/pull/57) ([dfang](https://github.com/dfang))
286
+
287
+ ## [v0.6.1](https://github.com/seuros/capistrano-puma/tree/v0.6.1) (2014-07-03)
288
+
289
+ [Full Changelog](https://github.com/seuros/capistrano-puma/compare/v0.2.0...v0.6.1)
290
+
291
+ **Merged pull requests:**
292
+
293
+ - Explicitly daemonize when needed. [\#54](https://github.com/seuros/capistrano-puma/pull/54) ([crohr](https://github.com/crohr))
294
+ - Access and Error logs where backwards [\#52](https://github.com/seuros/capistrano-puma/pull/52) ([rottmanj](https://github.com/rottmanj))
295
+ - Fix jungle tasks [\#47](https://github.com/seuros/capistrano-puma/pull/47) ([RavWar](https://github.com/RavWar))
296
+ - Make monit play well with chruby. [\#46](https://github.com/seuros/capistrano-puma/pull/46) ([linjunpop](https://github.com/linjunpop))
297
+ - fix and beautify puma-deb, closes \#44 [\#45](https://github.com/seuros/capistrano-puma/pull/45) ([masterkain](https://github.com/masterkain))
298
+ - puma jungle start stop restart fix [\#38](https://github.com/seuros/capistrano-puma/pull/38) ([petertoth](https://github.com/petertoth))
299
+ - check redhat-release first [\#34](https://github.com/seuros/capistrano-puma/pull/34) ([marshall-lee](https://github.com/marshall-lee))
300
+ - set rack\_env before command execution [\#29](https://github.com/seuros/capistrano-puma/pull/29) ([arielze](https://github.com/arielze))
301
+
302
+ ## [v0.2.0](https://github.com/seuros/capistrano-puma/tree/v0.2.0) (2014-01-28)
303
+
304
+ [Full Changelog](https://github.com/seuros/capistrano-puma/compare/4068552029ae7f40963afaa6d45d2877c7806d8d...v0.2.0)
305
+
306
+ **Merged pull requests:**
307
+
308
+ - add a trigger to puma config, for support Issue \#25 [\#26](https://github.com/seuros/capistrano-puma/pull/26) ([crhan](https://github.com/crhan))
309
+ - bump version for support capistrano v3.1 [\#24](https://github.com/seuros/capistrano-puma/pull/24) ([crhan](https://github.com/crhan))
310
+ - capistrano v3.1 compatible improve: dependency solve [\#22](https://github.com/seuros/capistrano-puma/pull/22) ([crhan](https://github.com/crhan))
311
+ - phased-restart also check for pid file first [\#21](https://github.com/seuros/capistrano-puma/pull/21) ([crhan](https://github.com/crhan))
312
+ - check pid instead of state file [\#20](https://github.com/seuros/capistrano-puma/pull/20) ([crhan](https://github.com/crhan))
313
+ - fix puma/puma\#300: Gemfile not refreshed between deploys [\#19](https://github.com/seuros/capistrano-puma/pull/19) ([crhan](https://github.com/crhan))
314
+ - Update README.md [\#17](https://github.com/seuros/capistrano-puma/pull/17) ([James-Hendrickson](https://github.com/James-Hendrickson))
315
+ - Sane defaults and puma:check [\#15](https://github.com/seuros/capistrano-puma/pull/15) ([shaneog](https://github.com/shaneog))
316
+ - run puma and pumactl with bundler [\#14](https://github.com/seuros/capistrano-puma/pull/14) ([ayamomiji](https://github.com/ayamomiji))
317
+ - Ensures that it will bundle w/ capistrano 3.1 [\#6](https://github.com/seuros/capistrano-puma/pull/6) ([kyledecot](https://github.com/kyledecot))
318
+
319
+
320
+
321
+ \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
data/Gemfile CHANGED
@@ -2,3 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in capistrano-puma.gemspec
4
4
  gemspec
5
+
6
+ gem "bump", "~> 0.10.0"
7
+
8
+ gem "github_changelog_generator", "~> 1.16"
data/README.md CHANGED
@@ -32,7 +32,7 @@ install_plugin Capistrano::Puma::Daemon # If you using puma daemonized (not sup
32
32
  ```
33
33
  or
34
34
  ```ruby
35
- install_plugin Capistrano::Puma::Systemd # if you use SystemD
35
+ install_plugin Capistrano::Puma::Systemd # if you use SystemD
36
36
  ```
37
37
 
38
38
  To prevent loading the hooks of the plugin, add false to the load_hooks param.
@@ -47,8 +47,8 @@ To prevent loading the hooks of the plugin, add false to the load_hooks param.
47
47
  To make it work with rvm, rbenv and chruby, install the plugin after corresponding library inclusion.
48
48
  ```ruby
49
49
  # Capfile
50
-
51
- require 'capistrano/rbenv'
50
+
51
+ require 'capistrano/rbenv'
52
52
  require 'capistrano/puma'
53
53
  install_plugin Capistrano::Puma
54
54
  ```
@@ -123,11 +123,33 @@ To use customize environment variables
123
123
  ```
124
124
  ```ruby
125
125
  set :puma_service_unit_env_vars, %w[
126
- RAILSE_NV=development
126
+ RAILS_ENV=development
127
127
  PUMA_METRICS_HTTP=tcp://0.0.0.0:9393
128
128
  ]
129
129
  ```
130
130
 
131
+ To use [phased restart](https://github.com/puma/puma/blob/master/docs/restart.md) for zero downtime deployments:
132
+
133
+ ```ruby
134
+ set :puma_phased_restart, true
135
+ ```
136
+
137
+ ### Systemd Socket Activation
138
+
139
+ Systemd socket activation starts your app upon first request if it is not already running
140
+
141
+ ```ruby
142
+ set :puma_enable_socket_service, true
143
+ ```
144
+
145
+ For more information on socket activation have a look at the `systemd.socket` [man page](https://man7.org/linux/man-pages/man5/systemd.socket.5.html).
146
+
147
+ To restart the listening socket using Systemd run
148
+ ```
149
+ cap puma:systemd:restart_socket
150
+ ```
151
+ This would also restart the puma instance as the puma service depends on the socket service being active
152
+
131
153
  ### Multi bind
132
154
 
133
155
  Multi-bind can be set with an array in the puma_bind variable
@@ -171,8 +193,12 @@ Configurable options, shown here with defaults: Please note the configuration op
171
193
  set :puma_tag, fetch(:application)
172
194
  set :puma_restart_command, 'bundle exec puma'
173
195
  set :puma_service_unit_name, "puma_#{fetch(:application)}_#{fetch(:stage)}"
196
+ set :puma_systemctl_user, :system # accepts :user
197
+ set :puma_enable_lingering, fetch(:puma_systemctl_user) != :system # https://wiki.archlinux.org/index.php/systemd/User#Automatic_start-up_of_systemd_user_instances
198
+ set :puma_lingering_user, fetch(:user)
174
199
  set :puma_service_unit_env_file, nil
175
200
  set :puma_service_unit_env_vars, []
201
+ set :puma_phased_restart, false
176
202
 
177
203
  set :nginx_config_name, "#{fetch(:application)}_#{fetch(:stage)}"
178
204
  set :nginx_flags, 'fail_timeout=0'
data/Rakefile CHANGED
@@ -1 +1,9 @@
1
1
  require "bundler/gem_tasks"
2
+ require 'github_changelog_generator/task'
3
+
4
+ GitHubChangelogGenerator::RakeTask.new :changelog do |config|
5
+ config.user = 'seuros'
6
+ config.project = 'capistrano-puma'
7
+ config.issues = false
8
+ config.future_release = '5.2.0'
9
+ end
@@ -3,7 +3,7 @@ module Capistrano
3
3
  include PumaCommon
4
4
 
5
5
  def register_hooks
6
- after 'deploy:finished', 'puma:restart'
6
+ after 'deploy:finished', 'puma:smart_restart'
7
7
  end
8
8
 
9
9
  def define_tasks
@@ -13,8 +13,46 @@ module Capistrano
13
13
  def set_defaults
14
14
  set_if_empty :puma_systemctl_bin, '/bin/systemctl'
15
15
  set_if_empty :puma_service_unit_name, -> { "puma_#{fetch(:application)}_#{fetch(:stage)}" }
16
- set_if_empty :puma_service_unit_user, :system
17
- set_if_empty :puma_enable_lingering, false
16
+ set_if_empty :puma_enable_socket_service, -> { false }
17
+ set_if_empty :puma_systemctl_user, :system
18
+ set_if_empty :puma_enable_lingering, -> { fetch(:puma_systemctl_user) != :system }
19
+ set_if_empty :puma_lingering_user, -> { fetch(:user) }
20
+ set_if_empty :puma_phased_restart, -> { false }
21
+ end
22
+
23
+ def expanded_bundle_command
24
+ backend.capture(:echo, SSHKit.config.command_map[:bundle]).strip
25
+ end
26
+
27
+ def fetch_systemd_unit_path
28
+ if fetch(:puma_systemctl_user) == :system
29
+ "/etc/systemd/system/"
30
+ else
31
+ home_dir = backend.capture :pwd
32
+ File.join(home_dir, ".config", "systemd", "user")
33
+ end
34
+ end
35
+
36
+ def systemd_command(*args)
37
+ command = [fetch(:puma_systemctl_bin)]
38
+
39
+ unless fetch(:puma_systemctl_user) == :system
40
+ command << "--user"
41
+ end
42
+
43
+ command + args
44
+ end
45
+
46
+ def sudo_if_needed(*command)
47
+ if fetch(:puma_systemctl_user) == :system
48
+ backend.sudo command.map(&:to_s).join(" ")
49
+ else
50
+ backend.execute(*command)
51
+ end
52
+ end
53
+
54
+ def execute_systemd(*args)
55
+ sudo_if_needed(*systemd_command(*args))
18
56
  end
19
57
  end
20
58
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Capistrano
2
- PUMAVERSION = '5.0.3'
4
+ PUMAVERSION = '5.2.0'
3
5
  end
@@ -1,5 +1,5 @@
1
1
  require 'capistrano/bundler'
2
- require "capistrano/plugin"
2
+ require 'capistrano/plugin'
3
3
 
4
4
  module Capistrano
5
5
  module PumaCommon
@@ -28,8 +28,7 @@ module Capistrano
28
28
  end.join("\n")
29
29
  end
30
30
 
31
-
32
- def template_puma(from, to, role)
31
+ def compiled_template_puma(from, role)
33
32
  @role = role
34
33
  file = [
35
34
  "lib/capistrano/templates/#{from}-#{role.hostname}-#{fetch(:stage)}.rb",
@@ -45,7 +44,50 @@ module Capistrano
45
44
  File.expand_path("../templates/#{from}.rb.erb", __FILE__)
46
45
  ].detect { |path| File.file?(path) }
47
46
  erb = File.read(file)
48
- backend.upload! StringIO.new(ERB.new(erb, nil, '-').result(binding)), to
47
+ StringIO.new(ERB.new(erb, nil, '-').result(binding))
48
+ end
49
+
50
+ def template_puma(from, to, role)
51
+ backend.upload! compiled_template_puma(from, role), to
52
+ end
53
+
54
+ PumaBind = Struct.new(:full_address, :kind, :address) do
55
+ def unix?
56
+ kind == :unix
57
+ end
58
+
59
+ def ssl?
60
+ kind == :ssl
61
+ end
62
+
63
+ def tcp
64
+ kind == :tcp || ssl?
65
+ end
66
+
67
+ def local
68
+ if unix?
69
+ self
70
+ else
71
+ PumaBind.new(
72
+ localize_address(full_address),
73
+ kind,
74
+ localize_address(address)
75
+ )
76
+ end
77
+ end
78
+
79
+ private
80
+
81
+ def localize_address(address)
82
+ address.gsub(/0\.0\.0\.0(.+)/, "127.0.0.1\\1")
83
+ end
84
+ end
85
+
86
+ def puma_binds
87
+ Array(fetch(:puma_bind)).map do |m|
88
+ etype, address = /(tcp|unix|ssl):\/{1,2}(.+)/.match(m).captures
89
+ PumaBind.new(m, etype.to_sym, address)
90
+ end
49
91
  end
50
92
  end
51
93
 
@@ -11,4 +11,12 @@ namespace :puma do
11
11
  end
12
12
  end
13
13
  end
14
+
15
+ desc 'Generate nginx configuration locally'
16
+ task :generate_nginx_config_locally do
17
+ fake_role = Struct.new(:hostname)
18
+ run_locally do
19
+ File.write('nginx.conf', git_plugin.compiled_template_puma("nginx_conf", fake_role.new("example.com")).string)
20
+ end
21
+ end
14
22
  end
@@ -7,16 +7,36 @@ namespace :puma do
7
7
  desc 'Config Puma systemd service'
8
8
  task :config do
9
9
  on roles(fetch(:puma_role)) do |role|
10
- unit_filename = "#{fetch(:puma_service_unit_name)}.service"
11
- git_plugin.template_puma "puma.service", "#{fetch(:tmp_dir)}/#{unit_filename}", role
12
- systemd_path = fetch(:puma_systemd_conf_dir, git_plugin.fetch_systemd_unit_path)
13
- if fetch(:puma_systemctl_user) == :system
14
- sudo "mv #{fetch(:tmp_dir)}/#{unit_filename} #{systemd_path}"
15
- sudo "#{fetch(:puma_systemctl_bin)} daemon-reload"
16
- else
17
- execute :mkdir, "-p", systemd_path
18
- execute :mv, "#{fetch(:tmp_dir)}/#{unit_filename}", "#{systemd_path}"
19
- execute fetch(:puma_systemctl_bin), "--user", "daemon-reload"
10
+
11
+ upload_compiled_template = lambda do |template_name, unit_filename|
12
+ git_plugin.template_puma template_name, "#{fetch(:tmp_dir)}/#{unit_filename}", role
13
+ systemd_path = fetch(:puma_systemd_conf_dir, git_plugin.fetch_systemd_unit_path)
14
+ if fetch(:puma_systemctl_user) == :system
15
+ sudo "mv #{fetch(:tmp_dir)}/#{unit_filename} #{systemd_path}"
16
+ else
17
+ execute :mkdir, "-p", systemd_path
18
+ execute :mv, "#{fetch(:tmp_dir)}/#{unit_filename}", "#{systemd_path}"
19
+ end
20
+ end
21
+
22
+ upload_compiled_template.call("puma.service", "#{fetch(:puma_service_unit_name)}.service")
23
+
24
+ if fetch(:puma_enable_socket_service)
25
+ upload_compiled_template.call("puma.socket", "#{fetch(:puma_service_unit_name)}.socket")
26
+ end
27
+
28
+ # Reload systemd
29
+ git_plugin.execute_systemd("daemon-reload")
30
+ end
31
+ end
32
+
33
+ desc 'Generate service configuration locally'
34
+ task :generate_config_locally do
35
+ fake_role = Struct.new(:hostname)
36
+ run_locally do
37
+ File.write('puma.service', git_plugin.compiled_template_puma("puma.service", fake_role.new("example.com")).string)
38
+ if fetch(:puma_enable_socket_service)
39
+ File.write('puma.socket', git_plugin.compiled_template_puma("puma.socket", fake_role.new("example.com")).string)
20
40
  end
21
41
  end
22
42
  end
@@ -24,11 +44,11 @@ namespace :puma do
24
44
  desc 'Enable Puma systemd service'
25
45
  task :enable do
26
46
  on roles(fetch(:puma_role)) do
27
- if fetch(:puma_systemctl_user) == :system
28
- sudo "#{fetch(:puma_systemctl_bin)} enable #{fetch(:puma_service_unit_name)}"
29
- else
30
- execute "#{fetch(:puma_systemctl_bin)}", "--user", "enable", fetch(:puma_service_unit_name)
31
- execute :loginctl, "enable-linger", fetch(:puma_lingering_user) if fetch(:puma_enable_lingering)
47
+ git_plugin.execute_systemd("enable", fetch(:puma_service_unit_name))
48
+ git_plugin.execute_systemd("enable", fetch(:puma_service_unit_name) + ".socket") if fetch(:puma_enable_socket_service)
49
+
50
+ if fetch(:puma_systemctl_user) != :system && fetch(:puma_enable_lingering)
51
+ execute :loginctl, "enable-linger", fetch(:puma_lingering_user)
32
52
  end
33
53
  end
34
54
  end
@@ -36,67 +56,81 @@ namespace :puma do
36
56
  desc 'Disable Puma systemd service'
37
57
  task :disable do
38
58
  on roles(fetch(:puma_role)) do
39
- if fetch(:puma_systemctl_user) == :system
40
- sudo "#{fetch(:puma_systemctl_bin)} disable #{fetch(:puma_service_unit_name)}"
41
- else
42
- execute "#{fetch(:puma_systemctl_bin)}", "--user", "disable", fetch(:puma_service_unit_name)
43
- end
59
+ git_plugin.execute_systemd("disable", fetch(:puma_service_unit_name))
60
+ git_plugin.execute_systemd("disable", fetch(:puma_service_unit_name) + ".socket") if fetch(:puma_enable_socket_service)
44
61
  end
45
62
  end
46
63
 
64
+ desc 'Stop Puma socket via systemd'
65
+ task :stop_socket do
66
+ on roles(fetch(:puma_role)) do
67
+ git_plugin.execute_systemd("stop", fetch(:puma_service_unit_name) + ".socket")
68
+ end
69
+ end
70
+
71
+ desc 'Restart Puma socket via systemd'
72
+ task :restart_socket do
73
+ on roles(fetch(:puma_role)) do
74
+ git_plugin.execute_systemd("restart", fetch(:puma_service_unit_name) + ".socket")
75
+ end
76
+ end
47
77
  end
48
78
 
49
79
  desc 'Start Puma service via systemd'
50
80
  task :start do
51
81
  on roles(fetch(:puma_role)) do
52
- if fetch(:puma_systemctl_user) == :system
53
- sudo "#{fetch(:puma_systemctl_bin)} start #{fetch(:puma_service_unit_name)}"
54
- else
55
- execute "#{fetch(:puma_systemctl_bin)}", "--user", "start", fetch(:puma_service_unit_name)
56
- end
82
+ git_plugin.execute_systemd("start", fetch(:puma_service_unit_name))
57
83
  end
58
84
  end
59
85
 
60
86
  desc 'Stop Puma service via systemd'
61
87
  task :stop do
62
88
  on roles(fetch(:puma_role)) do
63
- if fetch(:puma_systemctl_user) == :system
64
- sudo "#{fetch(:puma_systemctl_bin)} stop #{fetch(:puma_service_unit_name)}"
65
- else
66
- execute "#{fetch(:puma_systemctl_bin)}", "--user", "stop", fetch(:puma_service_unit_name)
67
- end
89
+ git_plugin.execute_systemd("stop", fetch(:puma_service_unit_name))
90
+ end
91
+ end
92
+
93
+ desc 'Restarts or reloads Puma service via systemd'
94
+ task :smart_restart do
95
+ if fetch(:puma_phased_restart)
96
+ invoke 'puma:reload'
97
+ else
98
+ invoke 'puma:restart'
68
99
  end
69
100
  end
70
101
 
71
102
  desc 'Restart Puma service via systemd'
72
103
  task :restart do
73
104
  on roles(fetch(:puma_role)) do
74
- if fetch(:puma_systemctl_user) == :system
75
- sudo "#{fetch(:puma_systemctl_bin)} restart #{fetch(:puma_service_unit_name)}"
76
- else
77
- execute "#{fetch(:puma_systemctl_bin)}", "--user", "restart", fetch(:puma_service_unit_name)
78
- end
105
+ git_plugin.execute_systemd("restart", fetch(:puma_service_unit_name))
79
106
  end
80
107
  end
81
108
 
82
- desc 'Get Puma service status via systemd'
83
- task :status do
109
+ desc 'Reload Puma service via systemd'
110
+ task :reload do
84
111
  on roles(fetch(:puma_role)) do
112
+ service_ok = if fetch(:puma_systemctl_user) == :system
113
+ execute("#{fetch(:puma_systemctl_bin)} status #{fetch(:puma_service_unit_name)} > /dev/null", raise_on_non_zero_exit: false)
114
+ else
115
+ execute("#{fetch(:puma_systemctl_bin)} --user status #{fetch(:puma_service_unit_name)} > /dev/null", raise_on_non_zero_exit: false)
116
+ end
117
+ cmd = 'reload'
118
+ if !service_ok
119
+ cmd = 'restart'
120
+ end
85
121
  if fetch(:puma_systemctl_user) == :system
86
- sudo "#{fetch(:puma_systemctl_bin)} status #{fetch(:puma_service_unit_name)}"
122
+ sudo "#{fetch(:puma_systemctl_bin)} #{cmd} #{fetch(:puma_service_unit_name)}"
87
123
  else
88
- execute "#{fetch(:puma_systemctl_bin)}", "--user", "status", fetch(:puma_service_unit_name)
124
+ execute "#{fetch(:puma_systemctl_bin)}", "--user", cmd, fetch(:puma_service_unit_name)
89
125
  end
90
126
  end
91
127
  end
92
128
 
93
- def fetch_systemd_unit_path
94
- if fetch(:puma_systemctl_user) == :system
95
- "/etc/systemd/system/"
96
- else
97
- home_dir = backend.capture :pwd
98
- File.join(home_dir, ".config", "systemd", "user")
129
+ desc 'Get Puma service status via systemd'
130
+ task :status do
131
+ on roles(fetch(:puma_role)) do
132
+ git_plugin.execute_systemd("status", fetch(:puma_service_unit_name))
133
+ git_plugin.execute_systemd("status", fetch(:puma_service_unit_name) + ".socket") if fetch(:puma_enable_socket_service)
99
134
  end
100
135
  end
101
-
102
136
  end
@@ -1,12 +1,11 @@
1
1
  upstream puma_<%= fetch(:nginx_config_name) %> { <%
2
- @backends = [fetch(:puma_bind)].flatten.map do |m|
3
- etype, address = /(tcp|unix|ssl):\/{1,2}(.+)/.match(m).captures
4
- if etype == 'unix'
5
- "server #{etype}:#{address} #{fetch(:nginx_socket_flags)};"
6
- else
7
- "server #{address.gsub(/0\.0\.0\.0(.+)/, "127.0.0.1\\1")} #{fetch(:nginx_http_flags)};"
2
+ @backends = puma_binds.map do |bind|
3
+ if bind.unix?
4
+ "server unix:#{bind.address} #{fetch(:nginx_socket_flags)};"
5
+ else
6
+ "server #{bind.local.address} #{fetch(:nginx_http_flags)};"
7
+ end
8
8
  end
9
- end
10
9
  %><% @backends.each do |server| %>
11
10
  <%= server %><% end %>
12
11
  }
@@ -1,13 +1,16 @@
1
1
  [Unit]
2
2
  Description=Puma HTTP Server for <%= "#{fetch(:application)} (#{fetch(:stage)})" %>
3
3
  After=network.target
4
+ <%= "Requires=#{fetch(:puma_service_unit_name)}.socket" if fetch(:puma_enable_socket_service) %>
4
5
 
5
6
  [Service]
6
7
  Type=simple
7
8
  <%="User=#{puma_user(@role)}" if fetch(:puma_systemctl_user) == :system %>
8
9
  WorkingDirectory=<%= current_path %>
9
- ExecStart=<%= SSHKit.config.command_map[:bundle] %> exec puma -C <%= fetch(:puma_conf) %>
10
- ExecReload=/bin/kill -TSTP $MAINPID
10
+ # Support older bundler versions where file descriptors weren't kept
11
+ # See https://github.com/rubygems/rubygems/issues/3254
12
+ ExecStart=<%= expanded_bundle_command %> exec --keep-file-descriptors puma -C <%= fetch(:puma_conf) %>
13
+ ExecReload=/bin/kill -USR1 $MAINPID
11
14
  StandardOutput=append:<%= fetch(:puma_access_log) %>
12
15
  StandardError=append:<%= fetch(:puma_error_log) %>
13
16
  <%="EnvironmentFile=#{fetch(:puma_service_unit_env_file)}" if fetch(:puma_service_unit_env_file) %>
@@ -0,0 +1,22 @@
1
+ [Unit]
2
+ Description=Puma HTTP Server Accept Sockets for <%= "#{fetch(:application)} (#{fetch(:stage)})" %>
3
+
4
+ [Socket]
5
+ <% puma_binds.each do |bind| -%>
6
+ <%= "ListenStream=#{bind.local.address}" %>
7
+ <% end -%>
8
+
9
+ # Don't let systemd accept the request, wait for Puma to do that.
10
+ # Systemd will start the puma service upon first request if it wasn't started.
11
+ #
12
+ # You might also want to set your Nginx upstream to have a fail_timeout large enough to accomodate your app's
13
+ # startup time.
14
+ Accept=no
15
+ <%= "NoDelay=true" if fetch(:puma_systemctl_user) == :system %>
16
+ ReusePort=true
17
+ Backlog=1024
18
+
19
+ SyslogIdentifier=puma_socket
20
+
21
+ [Install]
22
+ WantedBy=sockets.target
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano3-puma
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.3
4
+ version: 5.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abdelkader Boudih
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-23 00:00:00.000000000 Z
11
+ date: 2021-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -65,6 +65,7 @@ executables: []
65
65
  extensions: []
66
66
  extra_rdoc_files: []
67
67
  files:
68
+ - ".github/workflows/stale.yml"
68
69
  - ".gitignore"
69
70
  - CHANGELOG.md
70
71
  - CONTRIBUTORS.md
@@ -93,6 +94,7 @@ files:
93
94
  - lib/capistrano/templates/puma-rpm.erb
94
95
  - lib/capistrano/templates/puma.rb.erb
95
96
  - lib/capistrano/templates/puma.service.erb
97
+ - lib/capistrano/templates/puma.socket.erb
96
98
  - lib/capistrano/templates/puma_monit.conf.erb
97
99
  - lib/capistrano/templates/run-puma.erb
98
100
  - lib/capistrano3-puma.rb