capistrano3-puma 4.0.0 → 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: d3d97d6e6965faa5d7799a503e6730200c8f2c97c08a0eed22722bcde52927b4
4
- data.tar.gz: 3b4616be230f21b14404d8c5581da21997458f6fff8e8eaf42d6c1532dea8ca7
3
+ metadata.gz: 98e0fb64cfd73c2183c8ac641ec0e426f1721657254eeae1b6cebea4d9b34e78
4
+ data.tar.gz: 658219686493acef08d13c050c6d3c8536c980a6820d3d1165dcb5c3e3c80f89
5
5
  SHA512:
6
- metadata.gz: 16b7475339b600ddddccf305fa5b02195e7be896771934d5577960425be2bc14737f544cfc76f63d7ffdc2e58acf3d00b585fc0f7a6730b4465dc63d877c1a18
7
- data.tar.gz: 7432fbe4b4eac9c069c01da4774b0e12542ffb093112ea99ed8a177417ee994b94834b226d8d5e2072632eabcbabadd67361191d7981a449ce98b9e4cf17b52b
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,50 +1,321 @@
1
- ## Changelog
2
- - 4.0.0:
3
- - Support puma 4.x
4
- - 3.1.0:
5
- - Don't load puma hooks by default.
6
- - 3.0.0:
7
- - Require capistrano 3.7+
8
- - Implement the plugin system
9
- - don't fail if puma was already running
10
- - Added :puma_daemonize option (default is false)
11
-
12
- - 2.0.0:
13
- - Require puma 3.4+
14
- - Require Capistrano 3.5+
15
- - Require capistrano-bundler
16
-
17
- - 1.2.0: add support for puma user for puma user @mcb & @seuros
18
- - 1.1.0: Set :puma_preload_app to false; Reload Monit after uploading any monit configuration; Always refresh Gemfile @rafaelgoulart @suhailpatel @sime
19
- - 1.0.0: Add activate control app @askagirl
20
- - 0.8.5: Fix smart_restart task to check if puma preloads app
21
- - 0.8.4: Allow patch method (Nginx template) @lonre
22
- - 0.8.2: Start task creates a conf file if none exists @stevemadere
23
- - 0.8.1: Fixed nginx task @hnatt, support for prune_bundler @behe
24
- - 0.8.0: Some changes
25
- - 0.7.0: added Nginx template generator @dfang
26
- - 0.6.1: added :puma_default_hooks, you can turn off the automatic hooks by setting it false
27
- - 0.6.0: Remove `daemonize true` from default puma.rb file. Explicitly pass `--daemon` flag when needed.
28
- - 0.5.1: Added worker_timeout option
29
- - 0.5.0: Bugs fixes
30
- - 0.4.2: Fix monit template to support chruby
31
- - 0.4.1: Fix puma jungle (debian)
32
- - 0.4.0: Multi-bind support
33
- - 0.3.7: Dependency bug fix
34
- - 0.3.5: Fixed a prehistoric bug
35
- - 0.3.4: I don't remember what i did here
36
- - 0.3.3: Puma jungle start fix
37
- - 0.3.2: Tag option support (require puma 2.8.2+)
38
- - 0.3.1: Typo fix
39
- - 0.3.0: Initial support for puma signals
40
- - 0.2.2: Application pre-loading is optional now (set puma_preload_app to false to turn it off)
41
- - 0.2.1: Tasks are run within rack context
42
- - 0.2.0: Support for puma `ActiveRecord::Base.establish_connection` on
43
- boot
44
- - 0.1.3: Capistrano 3.1 support
45
- - 0.1.2: Gemfile are refreshed between deploys now
46
- - 0.1.1: Initial support for Monit and configuration override added.
47
- - 0.1.0: Phased restart will be used if puma is in cluster mode
48
- - 0.0.9: puma.rb location changed to shared_path root. puma:check moved to after deploy:check
49
- - 0.0.8: puma.rb is automatically generated if not present. Fixed RVM issue.
50
- - 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/CONTRIBUTORS.md CHANGED
@@ -45,3 +45,4 @@
45
45
  - Suraj Shirvankar
46
46
  - marshall-lee
47
47
  - ruohan chen
48
+ - ayaya zhao
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/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2013-2017 Abdelkader Boudih
3
+ Copyright (c) 2013-2020 Abdelkader Boudih
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -26,6 +26,14 @@ And then execute:
26
26
  install_plugin Capistrano::Puma::Monit # if you need the monit tasks
27
27
  install_plugin Capistrano::Puma::Nginx # if you want to upload a nginx site template
28
28
  ```
29
+ You will need to select your service manager
30
+ ```ruby
31
+ install_plugin Capistrano::Puma::Daemon # If you using puma daemonized (not supported in Puma 5+)
32
+ ```
33
+ or
34
+ ```ruby
35
+ install_plugin Capistrano::Puma::Systemd # if you use SystemD
36
+ ```
29
37
 
30
38
  To prevent loading the hooks of the plugin, add false to the load_hooks param.
31
39
  ```ruby
@@ -39,8 +47,8 @@ To prevent loading the hooks of the plugin, add false to the load_hooks param.
39
47
  To make it work with rvm, rbenv and chruby, install the plugin after corresponding library inclusion.
40
48
  ```ruby
41
49
  # Capfile
42
-
43
- require 'capistrano/rbenv'
50
+
51
+ require 'capistrano/rbenv'
44
52
  require 'capistrano/puma'
45
53
  install_plugin Capistrano::Puma
46
54
  ```
@@ -95,6 +103,53 @@ For Jungle tasks (beta), these options exist:
95
103
  set :puma_run_path, '/usr/local/bin/run-puma'
96
104
  ```
97
105
 
106
+ ### Systemd
107
+
108
+ Install Systemd plugin in `Capfile`:
109
+ ```ruby
110
+ install_plugin Capistrano::Puma
111
+ install_plugin Capistrano::Puma::Systemd
112
+ ```
113
+
114
+ To generate unit file use:
115
+ ```
116
+ cap production puma:systemd:config puma:systemd:enable
117
+ ```
118
+
119
+ To use customize environment variables
120
+
121
+ ```ruby
122
+ set :puma_service_unit_env_file, '/etc/environment'
123
+ ```
124
+ ```ruby
125
+ set :puma_service_unit_env_vars, %w[
126
+ RAILS_ENV=development
127
+ PUMA_METRICS_HTTP=tcp://0.0.0.0:9393
128
+ ]
129
+ ```
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
+
98
153
  ### Multi bind
99
154
 
100
155
  Multi-bind can be set with an array in the puma_bind variable
@@ -137,6 +192,13 @@ Configurable options, shown here with defaults: Please note the configuration op
137
192
  set :puma_plugins, [] #accept array of plugins
138
193
  set :puma_tag, fetch(:application)
139
194
  set :puma_restart_command, 'bundle exec puma'
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)
199
+ set :puma_service_unit_env_file, nil
200
+ set :puma_service_unit_env_vars, []
201
+ set :puma_phased_restart, false
140
202
 
141
203
  set :nginx_config_name, "#{fetch(:application)}_#{fetch(:stage)}"
142
204
  set :nginx_flags, 'fail_timeout=0'
@@ -148,6 +210,7 @@ Configurable options, shown here with defaults: Please note the configuration op
148
210
  set :nginx_ssl_certificate, "/etc/ssl/certs/#{fetch(:nginx_config_name)}.crt"
149
211
  set :nginx_ssl_certificate_key, "/etc/ssl/private/#{fetch(:nginx_config_name)}.key"
150
212
  set :nginx_use_ssl, false
213
+ set :nginx_use_http2, true
151
214
  set :nginx_downstream_uses_ssl, false
152
215
  ```
153
216
 
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
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_dependency 'capistrano', '~> 3.7'
22
22
  spec.add_dependency 'capistrano-bundler'
23
- spec.add_dependency 'puma' , '~> 4.0'
23
+ spec.add_dependency 'puma' , '>= 4.0', '< 6.0'
24
24
  spec.post_install_message = %q{
25
25
  All plugins need to be explicitly installed with install_plugin.
26
26
  Please see README.md
@@ -0,0 +1,13 @@
1
+ module Capistrano
2
+ class Puma::Daemon < Capistrano::Plugin
3
+ include PumaCommon
4
+
5
+ def register_hooks
6
+ after 'deploy:finished', 'puma:smart_restart'
7
+ end
8
+
9
+ def define_tasks
10
+ eval_rakefile File.expand_path('../../tasks/daemon.rake', __FILE__)
11
+ end
12
+ end
13
+ end
@@ -11,6 +11,7 @@ module Capistrano
11
11
  set_if_empty :nginx_http_flags, fetch(:nginx_flags)
12
12
  set_if_empty :nginx_socket_flags, fetch(:nginx_flags)
13
13
  set_if_empty :nginx_use_ssl, false
14
+ set_if_empty :nginx_use_http2, true
14
15
  set_if_empty :nginx_downstream_uses_ssl, false
15
16
  end
16
17
 
@@ -0,0 +1,58 @@
1
+ module Capistrano
2
+ class Puma::Systemd < Capistrano::Plugin
3
+ include PumaCommon
4
+
5
+ def register_hooks
6
+ after 'deploy:finished', 'puma:smart_restart'
7
+ end
8
+
9
+ def define_tasks
10
+ eval_rakefile File.expand_path('../../tasks/systemd.rake', __FILE__)
11
+ end
12
+
13
+ def set_defaults
14
+ set_if_empty :puma_systemctl_bin, '/bin/systemctl'
15
+ set_if_empty :puma_service_unit_name, -> { "puma_#{fetch(:application)}_#{fetch(:stage)}" }
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))
56
+ end
57
+ end
58
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Capistrano
2
- PUMAVERSION = '4.0.0'
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
 
@@ -89,7 +131,6 @@ module Capistrano
89
131
 
90
132
  def register_hooks
91
133
  after 'deploy:check', 'puma:check'
92
- after 'deploy:finished', 'puma:smart_restart'
93
134
  end
94
135
 
95
136
  def puma_workers
@@ -117,6 +158,8 @@ module Capistrano
117
158
  end
118
159
 
119
160
  require 'capistrano/puma/workers'
161
+ require 'capistrano/puma/daemon'
162
+ require 'capistrano/puma/systemd'
120
163
  require 'capistrano/puma/monit'
121
164
  require 'capistrano/puma/jungle'
122
165
  require 'capistrano/puma/nginx'
@@ -0,0 +1,74 @@
1
+ git_plugin = self
2
+
3
+ namespace :puma do
4
+ desc 'Start puma'
5
+ task :start do
6
+ on roles(fetch(:puma_role)) do |role|
7
+ git_plugin.puma_switch_user(role) do
8
+ if test "[ -f #{fetch(:puma_pid)} ]" and test :kill, "-0 $( cat #{fetch(:puma_pid)} )"
9
+ info 'Puma is already running'
10
+ else
11
+ within current_path do
12
+ with rack_env: fetch(:puma_env) do
13
+ execute :puma, "-C #{fetch(:puma_conf)} --daemon"
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
20
+
21
+ %w[halt stop status].map do |command|
22
+ desc "#{command} puma"
23
+ task command do
24
+ on roles (fetch(:puma_role)) do |role|
25
+ within current_path do
26
+ git_plugin.puma_switch_user(role) do
27
+ with rack_env: fetch(:puma_env) do
28
+ if test "[ -f #{fetch(:puma_pid)} ]"
29
+ if test :kill, "-0 $( cat #{fetch(:puma_pid)} )"
30
+ execute :pumactl, "-S #{fetch(:puma_state)} -F #{fetch(:puma_conf)} #{command}"
31
+ else
32
+ # delete invalid pid file , process is not running.
33
+ execute :rm, fetch(:puma_pid)
34
+ end
35
+ else
36
+ #pid file not found, so puma is probably not running or it using another pidfile
37
+ warn 'Puma not running'
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
45
+
46
+ %w[phased-restart restart].map do |command|
47
+ desc "#{command} puma"
48
+ task command do
49
+ on roles (fetch(:puma_role)) do |role|
50
+ within current_path do
51
+ git_plugin.puma_switch_user(role) do
52
+ with rack_env: fetch(:puma_env) do
53
+ if test "[ -f #{fetch(:puma_pid)} ]" and test :kill, "-0 $( cat #{fetch(:puma_pid)} )"
54
+ # NOTE pid exist but state file is nonsense, so ignore that case
55
+ execute :pumactl, "-S #{fetch(:puma_state)} -F #{fetch(:puma_conf)} #{command}"
56
+ else
57
+ # Puma is not running or state file is not present : Run it
58
+ invoke 'puma:start'
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
66
+
67
+ task :smart_restart do
68
+ if !fetch(:puma_preload_app) && fetch(:puma_workers, 0).to_i > 1
69
+ invoke 'puma:phased-restart'
70
+ else
71
+ invoke 'puma:restart'
72
+ end
73
+ end
74
+ end
@@ -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
@@ -8,75 +8,6 @@ namespace :puma do
8
8
  end
9
9
  end
10
10
 
11
- desc 'Start puma'
12
- task :start do
13
- on roles(fetch(:puma_role)) do |role|
14
- git_plugin.puma_switch_user(role) do
15
- if test "[ -f #{fetch(:puma_conf)} ]"
16
- info "using conf file #{fetch(:puma_conf)}"
17
- else
18
- invoke 'puma:config'
19
- end
20
-
21
- if test "[ -f #{fetch(:puma_pid)} ]" and test :kill, "-0 $( cat #{fetch(:puma_pid)} )"
22
- info 'Already Puma is running'
23
- else
24
- within current_path do
25
- with rack_env: fetch(:puma_env) do
26
- execute :puma, "-C #{fetch(:puma_conf)} --daemon"
27
- end
28
- end
29
- end
30
- end
31
- end
32
- end
33
-
34
- %w[halt stop status].map do |command|
35
- desc "#{command} puma"
36
- task command do
37
- on roles (fetch(:puma_role)) do |role|
38
- within current_path do
39
- git_plugin.puma_switch_user(role) do
40
- with rack_env: fetch(:puma_env) do
41
- if test "[ -f #{fetch(:puma_pid)} ]"
42
- if test :kill, "-0 $( cat #{fetch(:puma_pid)} )"
43
- execute :pumactl, "-S #{fetch(:puma_state)} -F #{fetch(:puma_conf)} #{command}"
44
- else
45
- # delete invalid pid file , process is not running.
46
- execute :rm, fetch(:puma_pid)
47
- end
48
- else
49
- #pid file not found, so puma is probably not running or it using another pidfile
50
- warn 'Puma not running'
51
- end
52
- end
53
- end
54
- end
55
- end
56
- end
57
- end
58
-
59
- %w[phased-restart restart].map do |command|
60
- desc "#{command} puma"
61
- task command do
62
- on roles (fetch(:puma_role)) do |role|
63
- within current_path do
64
- git_plugin.puma_switch_user(role) do
65
- with rack_env: fetch(:puma_env) do
66
- if test "[ -f #{fetch(:puma_pid)} ]" and test :kill, "-0 $( cat #{fetch(:puma_pid)} )"
67
- # NOTE pid exist but state file is nonsense, so ignore that case
68
- execute :pumactl, "-S #{fetch(:puma_state)} -F #{fetch(:puma_conf)} #{command}"
69
- else
70
- # Puma is not running or state file is not present : Run it
71
- invoke 'puma:start'
72
- end
73
- end
74
- end
75
- end
76
- end
77
- end
78
- end
79
-
80
11
  task :check do
81
12
  on roles(fetch(:puma_role)) do |role|
82
13
  #Create puma.rb for new deployments
@@ -87,14 +18,4 @@ namespace :puma do
87
18
  end
88
19
  end
89
20
  end
90
-
91
-
92
- task :smart_restart do
93
- if !git_plugin.puma_preload_app? && git_plugin.puma_workers.to_i > 1
94
- invoke 'puma:phased-restart'
95
- else
96
- invoke 'puma:restart'
97
- end
98
- end
99
-
100
21
  end
@@ -0,0 +1,136 @@
1
+ # frozen_string_literal: true
2
+
3
+ git_plugin = self
4
+
5
+ namespace :puma do
6
+ namespace :systemd do
7
+ desc 'Config Puma systemd service'
8
+ task :config do
9
+ on roles(fetch(:puma_role)) do |role|
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)
40
+ end
41
+ end
42
+ end
43
+
44
+ desc 'Enable Puma systemd service'
45
+ task :enable do
46
+ on roles(fetch(:puma_role)) do
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)
52
+ end
53
+ end
54
+ end
55
+
56
+ desc 'Disable Puma systemd service'
57
+ task :disable do
58
+ on roles(fetch(:puma_role)) do
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)
61
+ end
62
+ end
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
77
+ end
78
+
79
+ desc 'Start Puma service via systemd'
80
+ task :start do
81
+ on roles(fetch(:puma_role)) do
82
+ git_plugin.execute_systemd("start", fetch(:puma_service_unit_name))
83
+ end
84
+ end
85
+
86
+ desc 'Stop Puma service via systemd'
87
+ task :stop do
88
+ on roles(fetch(:puma_role)) do
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'
99
+ end
100
+ end
101
+
102
+ desc 'Restart Puma service via systemd'
103
+ task :restart do
104
+ on roles(fetch(:puma_role)) do
105
+ git_plugin.execute_systemd("restart", fetch(:puma_service_unit_name))
106
+ end
107
+ end
108
+
109
+ desc 'Reload Puma service via systemd'
110
+ task :reload do
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
121
+ if fetch(:puma_systemctl_user) == :system
122
+ sudo "#{fetch(:puma_systemctl_bin)} #{cmd} #{fetch(:puma_service_unit_name)}"
123
+ else
124
+ execute "#{fetch(:puma_systemctl_bin)}", "--user", cmd, fetch(:puma_service_unit_name)
125
+ end
126
+ end
127
+ end
128
+
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)
134
+ end
135
+ end
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
  }
@@ -20,8 +19,11 @@ server {
20
19
 
21
20
  server {
22
21
  <% if fetch(:nginx_use_ssl) -%>
23
- listen 443;
24
- ssl on;
22
+ <% if fetch(:nginx_use_http2) -%>
23
+ listen 443 ssl http2;
24
+ <% else -%>
25
+ listen 443 ssl;
26
+ <% end -%>
25
27
  <% if fetch(:nginx_ssl_certificate) -%>
26
28
  ssl_certificate <%= fetch(:nginx_ssl_certificate) %>;
27
29
  <% else -%>
@@ -48,6 +50,7 @@ server {
48
50
  location @puma_<%= fetch(:nginx_config_name) %> {
49
51
  proxy_http_version 1.1;
50
52
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
53
+ proxy_set_header X-Forwarded-Proto $scheme;
51
54
  proxy_set_header Host $host;
52
55
  proxy_redirect off;
53
56
  proxy_set_header Upgrade $http_upgrade;
File without changes
@@ -0,0 +1,28 @@
1
+ [Unit]
2
+ Description=Puma HTTP Server for <%= "#{fetch(:application)} (#{fetch(:stage)})" %>
3
+ After=network.target
4
+ <%= "Requires=#{fetch(:puma_service_unit_name)}.socket" if fetch(:puma_enable_socket_service) %>
5
+
6
+ [Service]
7
+ Type=simple
8
+ <%="User=#{puma_user(@role)}" if fetch(:puma_systemctl_user) == :system %>
9
+ WorkingDirectory=<%= current_path %>
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
14
+ StandardOutput=append:<%= fetch(:puma_access_log) %>
15
+ StandardError=append:<%= fetch(:puma_error_log) %>
16
+ <%="EnvironmentFile=#{fetch(:puma_service_unit_env_file)}" if fetch(:puma_service_unit_env_file) %>
17
+
18
+ <% fetch(:puma_service_unit_env_vars, []).each do |environment_variable| %>
19
+ <%="Environment=#{environment_variable}" %>
20
+ <% end %>
21
+
22
+ Restart=always
23
+ RestartSec=1
24
+
25
+ SyslogIdentifier=puma
26
+
27
+ [Install]
28
+ WantedBy=<%=(fetch(:puma_systemctl_user) == :system) ? "multi-user.target" : "default.target"%>
@@ -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: 4.0.0
4
+ version: 5.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abdelkader Boudih
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-27 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
@@ -42,16 +42,22 @@ dependencies:
42
42
  name: puma
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '4.0'
48
+ - - "<"
49
+ - !ruby/object:Gem::Version
50
+ version: '6.0'
48
51
  type: :runtime
49
52
  prerelease: false
50
53
  version_requirements: !ruby/object:Gem::Requirement
51
54
  requirements:
52
- - - "~>"
55
+ - - ">="
53
56
  - !ruby/object:Gem::Version
54
57
  version: '4.0'
58
+ - - "<"
59
+ - !ruby/object:Gem::Version
60
+ version: '6.0'
55
61
  description: Puma integration for Capistrano 3
56
62
  email:
57
63
  - Terminale@gmail.com
@@ -59,6 +65,7 @@ executables: []
59
65
  extensions: []
60
66
  extra_rdoc_files: []
61
67
  files:
68
+ - ".github/workflows/stale.yml"
62
69
  - ".gitignore"
63
70
  - CHANGELOG.md
64
71
  - CONTRIBUTORS.md
@@ -68,20 +75,26 @@ files:
68
75
  - Rakefile
69
76
  - capistrano3-puma.gemspec
70
77
  - lib/capistrano/puma.rb
78
+ - lib/capistrano/puma/daemon.rb
71
79
  - lib/capistrano/puma/jungle.rb
72
80
  - lib/capistrano/puma/monit.rb
73
81
  - lib/capistrano/puma/nginx.rb
82
+ - lib/capistrano/puma/systemd.rb
74
83
  - lib/capistrano/puma/version.rb
75
84
  - lib/capistrano/puma/workers.rb
85
+ - lib/capistrano/tasks/daemon.rake
76
86
  - lib/capistrano/tasks/jungle.rake
77
87
  - lib/capistrano/tasks/monit.rake
78
88
  - lib/capistrano/tasks/nginx.rake
79
89
  - lib/capistrano/tasks/puma.rake
90
+ - lib/capistrano/tasks/systemd.rake
80
91
  - lib/capistrano/tasks/workers.rake
81
92
  - lib/capistrano/templates/nginx_conf.erb
82
93
  - lib/capistrano/templates/puma-deb.erb
83
94
  - lib/capistrano/templates/puma-rpm.erb
84
95
  - lib/capistrano/templates/puma.rb.erb
96
+ - lib/capistrano/templates/puma.service.erb
97
+ - lib/capistrano/templates/puma.socket.erb
85
98
  - lib/capistrano/templates/puma_monit.conf.erb
86
99
  - lib/capistrano/templates/run-puma.erb
87
100
  - lib/capistrano3-puma.rb
@@ -107,9 +120,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
120
  - !ruby/object:Gem::Version
108
121
  version: '0'
109
122
  requirements: []
110
- rubyforge_project:
111
- rubygems_version: 2.7.6
112
- signing_key:
123
+ rubygems_version: 3.0.3
124
+ signing_key:
113
125
  specification_version: 4
114
126
  summary: Puma integration for Capistrano
115
127
  test_files: []