capistrano3-puma 5.0.4 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/stale.yml +19 -0
- data/CHANGELOG.md +305 -62
- data/Gemfile +4 -0
- data/README.md +20 -4
- data/lib/capistrano/puma/systemd.rb +37 -1
- data/lib/capistrano/puma/version.rb +1 -1
- data/lib/capistrano/puma.rb +46 -4
- data/lib/capistrano/tasks/nginx.rake +8 -0
- data/lib/capistrano/tasks/systemd.rake +67 -46
- data/lib/capistrano/templates/nginx_conf.erb +6 -7
- data/lib/capistrano/templates/puma.service.erb +5 -2
- data/lib/capistrano/templates/puma.socket.erb +22 -0
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dcfaacf27e221d3264c49f38d0b308c6128ce3ee40ed875b377b3d6d56d91be0
|
|
4
|
+
data.tar.gz: e1169b1352140e0844bd2368a5b574ae45dac7f18d37a29fb30c52c909deb3f7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 557f361be04705610f213170f453a7428bfb23c0cc94880d367ce1447c6b868d77a6245b60993292c04a0cd9455973ff47bef4871f351a8aa2c2fc009389c8e1
|
|
7
|
+
data.tar.gz: 8f015f5d97e148ccb26720707a37eedf6b2903487a5be3bd8565e399622b181defb29b6c53734e611980b8bf338bf9f1141d2a4873edcc1f91034801a040a51a
|
|
@@ -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,62 +1,305 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
-
|
|
62
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [Unreleased](https://github.com/seuros/capistrano-puma/tree/HEAD)
|
|
4
|
+
|
|
5
|
+
[Full Changelog](https://github.com/seuros/capistrano-puma/compare/v5.0.4...HEAD)
|
|
6
|
+
|
|
7
|
+
**Merged pull requests:**
|
|
8
|
+
|
|
9
|
+
- Phased restart [\#329](https://github.com/seuros/capistrano-puma/pull/329) ([mksvdmtr](https://github.com/mksvdmtr))
|
|
10
|
+
- fix typo in README.md [\#325](https://github.com/seuros/capistrano-puma/pull/325) ([Yuki-Inoue](https://github.com/Yuki-Inoue))
|
|
11
|
+
- Implement puma systemd sockets [\#324](https://github.com/seuros/capistrano-puma/pull/324) ([chriscz](https://github.com/chriscz))
|
|
12
|
+
|
|
13
|
+
## [v5.0.4](https://github.com/seuros/capistrano-puma/tree/v5.0.4) (2021-03-03)
|
|
14
|
+
|
|
15
|
+
[Full Changelog](https://github.com/seuros/capistrano-puma/compare/v5.0.3...v5.0.4)
|
|
16
|
+
|
|
17
|
+
**Merged pull requests:**
|
|
18
|
+
|
|
19
|
+
- fix: puma\_systemctl\_user default value [\#319](https://github.com/seuros/capistrano-puma/pull/319) ([davegudge](https://github.com/davegudge))
|
|
20
|
+
|
|
21
|
+
## [v5.0.3](https://github.com/seuros/capistrano-puma/tree/v5.0.3) (2021-02-23)
|
|
22
|
+
|
|
23
|
+
[Full Changelog](https://github.com/seuros/capistrano-puma/compare/v5.0.2...v5.0.3)
|
|
24
|
+
|
|
25
|
+
**Merged pull requests:**
|
|
26
|
+
|
|
27
|
+
- 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))
|
|
28
|
+
- Remove ExecStop from systemd unit file [\#314](https://github.com/seuros/capistrano-puma/pull/314) ([w-leads](https://github.com/w-leads))
|
|
29
|
+
- Default systemd service name on multi-app host [\#309](https://github.com/seuros/capistrano-puma/pull/309) ([bendilley](https://github.com/bendilley))
|
|
30
|
+
- Systemd user service manager and lingering [\#307](https://github.com/seuros/capistrano-puma/pull/307) ([farnsworth](https://github.com/farnsworth))
|
|
31
|
+
- 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))
|
|
32
|
+
|
|
33
|
+
## [v5.0.2](https://github.com/seuros/capistrano-puma/tree/v5.0.2) (2020-12-07)
|
|
34
|
+
|
|
35
|
+
[Full Changelog](https://github.com/seuros/capistrano-puma/compare/v5.0.1...v5.0.2)
|
|
36
|
+
|
|
37
|
+
**Merged pull requests:**
|
|
38
|
+
|
|
39
|
+
- Single name for systemd config template [\#308](https://github.com/seuros/capistrano-puma/pull/308) ([bendilley](https://github.com/bendilley))
|
|
40
|
+
|
|
41
|
+
## [v5.0.1](https://github.com/seuros/capistrano-puma/tree/v5.0.1) (2020-12-02)
|
|
42
|
+
|
|
43
|
+
[Full Changelog](https://github.com/seuros/capistrano-puma/compare/v5.0.0...v5.0.1)
|
|
44
|
+
|
|
45
|
+
**Merged pull requests:**
|
|
46
|
+
|
|
47
|
+
- Fix \#301, Task "puma:smart\_restart" not found [\#304](https://github.com/seuros/capistrano-puma/pull/304) ([Eric-Guo](https://github.com/Eric-Guo))
|
|
48
|
+
|
|
49
|
+
## [v5.0.0](https://github.com/seuros/capistrano-puma/tree/v5.0.0) (2020-12-01)
|
|
50
|
+
|
|
51
|
+
[Full Changelog](https://github.com/seuros/capistrano-puma/compare/v5.0.0.beta1...v5.0.0)
|
|
52
|
+
|
|
53
|
+
## [v5.0.0.beta1](https://github.com/seuros/capistrano-puma/tree/v5.0.0.beta1) (2020-11-04)
|
|
54
|
+
|
|
55
|
+
[Full Changelog](https://github.com/seuros/capistrano-puma/compare/v4.0.0...v5.0.0.beta1)
|
|
56
|
+
|
|
57
|
+
**Merged pull requests:**
|
|
58
|
+
|
|
59
|
+
- Add systemd support and puma 5 support [\#300](https://github.com/seuros/capistrano-puma/pull/300) ([ayamomiji](https://github.com/ayamomiji))
|
|
60
|
+
- Update nginx template [\#290](https://github.com/seuros/capistrano-puma/pull/290) ([neolyte](https://github.com/neolyte))
|
|
61
|
+
- Improve already running warning message [\#262](https://github.com/seuros/capistrano-puma/pull/262) ([jackbot](https://github.com/jackbot))
|
|
62
|
+
|
|
63
|
+
## [v4.0.0](https://github.com/seuros/capistrano-puma/tree/v4.0.0) (2019-06-27)
|
|
64
|
+
|
|
65
|
+
[Full Changelog](https://github.com/seuros/capistrano-puma/compare/v3.1.1...v4.0.0)
|
|
66
|
+
|
|
67
|
+
**Merged pull requests:**
|
|
68
|
+
|
|
69
|
+
- Change 3.4 to 4.0 [\#285](https://github.com/seuros/capistrano-puma/pull/285) ([paulomcnally](https://github.com/paulomcnally))
|
|
70
|
+
- Revert "Fixed call parameter" [\#282](https://github.com/seuros/capistrano-puma/pull/282) ([stefanwild](https://github.com/stefanwild))
|
|
71
|
+
- Fixed call parameter [\#280](https://github.com/seuros/capistrano-puma/pull/280) ([stefanwild](https://github.com/stefanwild))
|
|
72
|
+
- Use HTTP 1.1 for proxying [\#277](https://github.com/seuros/capistrano-puma/pull/277) ([amiuhle](https://github.com/amiuhle))
|
|
73
|
+
- Update README.md [\#276](https://github.com/seuros/capistrano-puma/pull/276) ([poyzn](https://github.com/poyzn))
|
|
74
|
+
- fix typo in readme [\#275](https://github.com/seuros/capistrano-puma/pull/275) ([knt45](https://github.com/knt45))
|
|
75
|
+
- 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))
|
|
76
|
+
- \#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))
|
|
77
|
+
- Wrong path to puma config fixed [\#249](https://github.com/seuros/capistrano-puma/pull/249) ([atilla777](https://github.com/atilla777))
|
|
78
|
+
- Update README.md [\#247](https://github.com/seuros/capistrano-puma/pull/247) ([lozhn](https://github.com/lozhn))
|
|
79
|
+
- Added shared puma conf as argument to jungle:add [\#238](https://github.com/seuros/capistrano-puma/pull/238) ([anonoz](https://github.com/anonoz))
|
|
80
|
+
|
|
81
|
+
## [v3.1.1](https://github.com/seuros/capistrano-puma/tree/v3.1.1) (2017-07-04)
|
|
82
|
+
|
|
83
|
+
[Full Changelog](https://github.com/seuros/capistrano-puma/compare/v3.1.0...v3.1.1)
|
|
84
|
+
|
|
85
|
+
**Merged pull requests:**
|
|
86
|
+
|
|
87
|
+
- Fix jungle setup for debian [\#235](https://github.com/seuros/capistrano-puma/pull/235) ([PavelBezpalov](https://github.com/PavelBezpalov))
|
|
88
|
+
- Force SSL/LTS with return directive [\#234](https://github.com/seuros/capistrano-puma/pull/234) ([notapatch](https://github.com/notapatch))
|
|
89
|
+
- Use `$host` to prevent forgery [\#232](https://github.com/seuros/capistrano-puma/pull/232) ([teeceepee](https://github.com/teeceepee))
|
|
90
|
+
- 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))
|
|
91
|
+
- Wait for Monit to be reloaded [\#224](https://github.com/seuros/capistrano-puma/pull/224) ([ivanovaleksey](https://github.com/ivanovaleksey))
|
|
92
|
+
- Update README.md [\#223](https://github.com/seuros/capistrano-puma/pull/223) ([notapatch](https://github.com/notapatch))
|
|
93
|
+
- \[Fix \#219\] Call execute on backend [\#222](https://github.com/seuros/capistrano-puma/pull/222) ([ivanovaleksey](https://github.com/ivanovaleksey))
|
|
94
|
+
- Add option to specify the location of SSL certificates [\#221](https://github.com/seuros/capistrano-puma/pull/221) ([wynksaiddestroy](https://github.com/wynksaiddestroy))
|
|
95
|
+
- 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))
|
|
96
|
+
- Add stage to cap commands [\#216](https://github.com/seuros/capistrano-puma/pull/216) ([wynksaiddestroy](https://github.com/wynksaiddestroy))
|
|
97
|
+
|
|
98
|
+
## [v3.1.0](https://github.com/seuros/capistrano-puma/tree/v3.1.0) (2017-03-24)
|
|
99
|
+
|
|
100
|
+
[Full Changelog](https://github.com/seuros/capistrano-puma/compare/v3.0.3...v3.1.0)
|
|
101
|
+
|
|
102
|
+
**Merged pull requests:**
|
|
103
|
+
|
|
104
|
+
- release 3.1.0 [\#212](https://github.com/seuros/capistrano-puma/pull/212) ([seuros](https://github.com/seuros))
|
|
105
|
+
- Minor fixes [\#211](https://github.com/seuros/capistrano-puma/pull/211) ([rojosinalma](https://github.com/rojosinalma))
|
|
106
|
+
- Fixes issue \#208 [\#209](https://github.com/seuros/capistrano-puma/pull/209) ([rojosinalma](https://github.com/rojosinalma))
|
|
107
|
+
- Give hint about appending variable values instead of setting them [\#207](https://github.com/seuros/capistrano-puma/pull/207) ([mcelicalderon](https://github.com/mcelicalderon))
|
|
108
|
+
|
|
109
|
+
## [v3.0.3](https://github.com/seuros/capistrano-puma/tree/v3.0.3) (2017-03-23)
|
|
110
|
+
|
|
111
|
+
[Full Changelog](https://github.com/seuros/capistrano-puma/compare/v3.0.2...v3.0.3)
|
|
112
|
+
|
|
113
|
+
## [v3.0.2](https://github.com/seuros/capistrano-puma/tree/v3.0.2) (2017-03-22)
|
|
114
|
+
|
|
115
|
+
[Full Changelog](https://github.com/seuros/capistrano-puma/compare/v3.0.1...v3.0.2)
|
|
116
|
+
|
|
117
|
+
**Merged pull requests:**
|
|
118
|
+
|
|
119
|
+
- Fix vars loading issue during plugin initialization [\#205](https://github.com/seuros/capistrano-puma/pull/205) ([ilyapoz](https://github.com/ilyapoz))
|
|
120
|
+
|
|
121
|
+
## [v3.0.1](https://github.com/seuros/capistrano-puma/tree/v3.0.1) (2017-03-20)
|
|
122
|
+
|
|
123
|
+
[Full Changelog](https://github.com/seuros/capistrano-puma/compare/v3.0.0...v3.0.1)
|
|
124
|
+
|
|
125
|
+
## [v3.0.0](https://github.com/seuros/capistrano-puma/tree/v3.0.0) (2017-03-18)
|
|
126
|
+
|
|
127
|
+
[Full Changelog](https://github.com/seuros/capistrano-puma/compare/v2.0.0...v3.0.0)
|
|
128
|
+
|
|
129
|
+
**Merged pull requests:**
|
|
130
|
+
|
|
131
|
+
- Release v3.0.0 candidate [\#201](https://github.com/seuros/capistrano-puma/pull/201) ([seuros](https://github.com/seuros))
|
|
132
|
+
- Add 'daemonize' config [\#194](https://github.com/seuros/capistrano-puma/pull/194) ([rhannequin](https://github.com/rhannequin))
|
|
133
|
+
|
|
134
|
+
## [v2.0.0](https://github.com/seuros/capistrano-puma/tree/v2.0.0) (2017-03-08)
|
|
135
|
+
|
|
136
|
+
[Full Changelog](https://github.com/seuros/capistrano-puma/compare/v1.2.1...v2.0.0)
|
|
137
|
+
|
|
138
|
+
**Merged pull requests:**
|
|
139
|
+
|
|
140
|
+
- Skip puma start command if puma is running [\#198](https://github.com/seuros/capistrano-puma/pull/198) ([mizukmb](https://github.com/mizukmb))
|
|
141
|
+
- Fix puma:monit task for first deployment [\#187](https://github.com/seuros/capistrano-puma/pull/187) ([lucasalves](https://github.com/lucasalves))
|
|
142
|
+
- Update workers.rake [\#186](https://github.com/seuros/capistrano-puma/pull/186) ([treenewbee](https://github.com/treenewbee))
|
|
143
|
+
- typo [\#178](https://github.com/seuros/capistrano-puma/pull/178) ([BenjaminKim](https://github.com/BenjaminKim))
|
|
144
|
+
- Modify README file [\#176](https://github.com/seuros/capistrano-puma/pull/176) ([00dav00](https://github.com/00dav00))
|
|
145
|
+
- Remove trailing lines in ERB files [\#171](https://github.com/seuros/capistrano-puma/pull/171) ([papilip](https://github.com/papilip))
|
|
146
|
+
- Closing ActiveRecord connections before forking [\#170](https://github.com/seuros/capistrano-puma/pull/170) ([marcoschicote](https://github.com/marcoschicote))
|
|
147
|
+
- Add support to plugins [\#168](https://github.com/seuros/capistrano-puma/pull/168) ([seuros](https://github.com/seuros))
|
|
148
|
+
- Add server\_name to the http-\>https redirection server block [\#147](https://github.com/seuros/capistrano-puma/pull/147) ([bdewater](https://github.com/bdewater))
|
|
149
|
+
- Fix README: default value of puma\_preload\_app is false [\#145](https://github.com/seuros/capistrano-puma/pull/145) ([snoozer05](https://github.com/snoozer05))
|
|
150
|
+
- Respect the global puma\_user setting [\#139](https://github.com/seuros/capistrano-puma/pull/139) ([jhollinger](https://github.com/jhollinger))
|
|
151
|
+
- Add puma commands to chruby\_map\_bins. [\#135](https://github.com/seuros/capistrano-puma/pull/135) ([linjunpop](https://github.com/linjunpop))
|
|
152
|
+
- Run the shell as a login shell. [\#132](https://github.com/seuros/capistrano-puma/pull/132) ([kgiszczak](https://github.com/kgiszczak))
|
|
153
|
+
- Issue \#120 -- explicitly pass the config file location to pumactl [\#129](https://github.com/seuros/capistrano-puma/pull/129) ([lhagemann](https://github.com/lhagemann))
|
|
154
|
+
- Use SSHKit command\_map [\#128](https://github.com/seuros/capistrano-puma/pull/128) ([hbin](https://github.com/hbin))
|
|
155
|
+
- Update Readme [\#127](https://github.com/seuros/capistrano-puma/pull/127) ([h0lyalg0rithm](https://github.com/h0lyalg0rithm))
|
|
156
|
+
|
|
157
|
+
## [v1.2.1](https://github.com/seuros/capistrano-puma/tree/v1.2.1) (2015-08-20)
|
|
158
|
+
|
|
159
|
+
[Full Changelog](https://github.com/seuros/capistrano-puma/compare/v1.2.0...v1.2.1)
|
|
160
|
+
|
|
161
|
+
**Merged pull requests:**
|
|
162
|
+
|
|
163
|
+
- Added fix for wrong arguments on puma stop [\#124](https://github.com/seuros/capistrano-puma/pull/124) ([rsov](https://github.com/rsov))
|
|
164
|
+
|
|
165
|
+
## [v1.2.0](https://github.com/seuros/capistrano-puma/tree/v1.2.0) (2015-08-19)
|
|
166
|
+
|
|
167
|
+
[Full Changelog](https://github.com/seuros/capistrano-puma/compare/v1.1.0...v1.2.0)
|
|
168
|
+
|
|
169
|
+
**Implemented enhancements:**
|
|
170
|
+
|
|
171
|
+
- Adds ssl configuration for nginx [\#116](https://github.com/seuros/capistrano-puma/pull/116) ([mdesanti](https://github.com/mdesanti))
|
|
172
|
+
|
|
173
|
+
**Merged pull requests:**
|
|
174
|
+
|
|
175
|
+
- new puma user log [\#122](https://github.com/seuros/capistrano-puma/pull/122) ([seuros](https://github.com/seuros))
|
|
176
|
+
- 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))
|
|
177
|
+
- Mcb/add support for puma user [\#117](https://github.com/seuros/capistrano-puma/pull/117) ([mcb](https://github.com/mcb))
|
|
178
|
+
- Fix puma\_monit\_bin [\#114](https://github.com/seuros/capistrano-puma/pull/114) ([msbrigna](https://github.com/msbrigna))
|
|
179
|
+
- Update monit tasks [\#113](https://github.com/seuros/capistrano-puma/pull/113) ([soylent](https://github.com/soylent))
|
|
180
|
+
|
|
181
|
+
## [v1.1.0](https://github.com/seuros/capistrano-puma/tree/v1.1.0) (2015-06-23)
|
|
182
|
+
|
|
183
|
+
[Full Changelog](https://github.com/seuros/capistrano-puma/compare/v1.0.0...v1.1.0)
|
|
184
|
+
|
|
185
|
+
**Merged pull requests:**
|
|
186
|
+
|
|
187
|
+
- Always refresh Gemfile. Fixes \#109 [\#110](https://github.com/seuros/capistrano-puma/pull/110) ([sime](https://github.com/sime))
|
|
188
|
+
- Reload Monit after uploading any monit configuration [\#108](https://github.com/seuros/capistrano-puma/pull/108) ([suhailpatel](https://github.com/suhailpatel))
|
|
189
|
+
- Set :puma\_preload\_app to false [\#104](https://github.com/seuros/capistrano-puma/pull/104) ([rafaelgoulart](https://github.com/rafaelgoulart))
|
|
190
|
+
|
|
191
|
+
## [v1.0.0](https://github.com/seuros/capistrano-puma/tree/v1.0.0) (2015-05-05)
|
|
192
|
+
|
|
193
|
+
[Full Changelog](https://github.com/seuros/capistrano-puma/compare/v0.9.0...v1.0.0)
|
|
194
|
+
|
|
195
|
+
**Merged pull requests:**
|
|
196
|
+
|
|
197
|
+
- Feature/add activate control app [\#103](https://github.com/seuros/capistrano-puma/pull/103) ([askagirl](https://github.com/askagirl))
|
|
198
|
+
- Missing 'r' in prune\_bundler [\#101](https://github.com/seuros/capistrano-puma/pull/101) ([sime](https://github.com/sime))
|
|
199
|
+
|
|
200
|
+
## [v0.9.0](https://github.com/seuros/capistrano-puma/tree/v0.9.0) (2015-03-20)
|
|
201
|
+
|
|
202
|
+
[Full Changelog](https://github.com/seuros/capistrano-puma/compare/v0.8.5...v0.9.0)
|
|
203
|
+
|
|
204
|
+
**Merged pull requests:**
|
|
205
|
+
|
|
206
|
+
- Update Typo in README [\#97](https://github.com/seuros/capistrano-puma/pull/97) ([kcollignon](https://github.com/kcollignon))
|
|
207
|
+
- bundler prune should be automatically detect [\#96](https://github.com/seuros/capistrano-puma/pull/96) ([crhan](https://github.com/crhan))
|
|
208
|
+
|
|
209
|
+
## [v0.8.5](https://github.com/seuros/capistrano-puma/tree/v0.8.5) (2015-01-30)
|
|
210
|
+
|
|
211
|
+
[Full Changelog](https://github.com/seuros/capistrano-puma/compare/v0.8.4...v0.8.5)
|
|
212
|
+
|
|
213
|
+
**Merged pull requests:**
|
|
214
|
+
|
|
215
|
+
- Fix smart\_restart task to check if puma preloads app [\#93](https://github.com/seuros/capistrano-puma/pull/93) ([sponomarev](https://github.com/sponomarev))
|
|
216
|
+
|
|
217
|
+
## [v0.8.4](https://github.com/seuros/capistrano-puma/tree/v0.8.4) (2015-01-25)
|
|
218
|
+
|
|
219
|
+
[Full Changelog](https://github.com/seuros/capistrano-puma/compare/v0.8.3...v0.8.4)
|
|
220
|
+
|
|
221
|
+
**Merged pull requests:**
|
|
222
|
+
|
|
223
|
+
- Allow PATCH method [\#91](https://github.com/seuros/capistrano-puma/pull/91) ([lonre](https://github.com/lonre))
|
|
224
|
+
- Allow unix:/foo/ socket URLs [\#90](https://github.com/seuros/capistrano-puma/pull/90) ([indirect](https://github.com/indirect))
|
|
225
|
+
- Fix puma:monit task descriptions [\#88](https://github.com/seuros/capistrano-puma/pull/88) ([jc00ke](https://github.com/jc00ke))
|
|
226
|
+
- Convert to spaces [\#85](https://github.com/seuros/capistrano-puma/pull/85) ([lonre](https://github.com/lonre))
|
|
227
|
+
- Minor documentation correction [\#84](https://github.com/seuros/capistrano-puma/pull/84) ([neilbartley](https://github.com/neilbartley))
|
|
228
|
+
- appending :stage to puma's monit [\#81](https://github.com/seuros/capistrano-puma/pull/81) ([itsNikolay](https://github.com/itsNikolay))
|
|
229
|
+
|
|
230
|
+
## [v0.8.3](https://github.com/seuros/capistrano-puma/tree/v0.8.3) (2014-10-28)
|
|
231
|
+
|
|
232
|
+
[Full Changelog](https://github.com/seuros/capistrano-puma/compare/v0.8.2...v0.8.3)
|
|
233
|
+
|
|
234
|
+
## [v0.8.2](https://github.com/seuros/capistrano-puma/tree/v0.8.2) (2014-10-17)
|
|
235
|
+
|
|
236
|
+
[Full Changelog](https://github.com/seuros/capistrano-puma/compare/v0.8.1...v0.8.2)
|
|
237
|
+
|
|
238
|
+
**Merged pull requests:**
|
|
239
|
+
|
|
240
|
+
- Start task creates a conf file if none exists. [\#74](https://github.com/seuros/capistrano-puma/pull/74) ([stevemadere](https://github.com/stevemadere))
|
|
241
|
+
|
|
242
|
+
## [v0.8.1](https://github.com/seuros/capistrano-puma/tree/v0.8.1) (2014-10-08)
|
|
243
|
+
|
|
244
|
+
[Full Changelog](https://github.com/seuros/capistrano-puma/compare/v0.8.0...v0.8.1)
|
|
245
|
+
|
|
246
|
+
**Merged pull requests:**
|
|
247
|
+
|
|
248
|
+
- Fix nginx config task work with roles [\#72](https://github.com/seuros/capistrano-puma/pull/72) ([hnatt](https://github.com/hnatt))
|
|
249
|
+
- Fix puma\_bind unix socket path [\#70](https://github.com/seuros/capistrano-puma/pull/70) ([hnatt](https://github.com/hnatt))
|
|
250
|
+
- Update nginx\_config task call example in README [\#69](https://github.com/seuros/capistrano-puma/pull/69) ([hnatt](https://github.com/hnatt))
|
|
251
|
+
- Added config option for prune\_bundler [\#68](https://github.com/seuros/capistrano-puma/pull/68) ([behe](https://github.com/behe))
|
|
252
|
+
|
|
253
|
+
## [v0.8.0](https://github.com/seuros/capistrano-puma/tree/v0.8.0) (2014-09-23)
|
|
254
|
+
|
|
255
|
+
[Full Changelog](https://github.com/seuros/capistrano-puma/compare/v0.7.0...v0.8.0)
|
|
256
|
+
|
|
257
|
+
**Merged pull requests:**
|
|
258
|
+
|
|
259
|
+
- Update puma.cap to add missing , [\#65](https://github.com/seuros/capistrano-puma/pull/65) ([bryanl](https://github.com/bryanl))
|
|
260
|
+
- 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))
|
|
261
|
+
- Cannot call nginx:config cap task [\#61](https://github.com/seuros/capistrano-puma/pull/61) ([isc](https://github.com/isc))
|
|
262
|
+
|
|
263
|
+
## [v0.7.0](https://github.com/seuros/capistrano-puma/tree/v0.7.0) (2014-08-07)
|
|
264
|
+
|
|
265
|
+
[Full Changelog](https://github.com/seuros/capistrano-puma/compare/v0.6.1...v0.7.0)
|
|
266
|
+
|
|
267
|
+
**Merged pull requests:**
|
|
268
|
+
|
|
269
|
+
- 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))
|
|
270
|
+
|
|
271
|
+
## [v0.6.1](https://github.com/seuros/capistrano-puma/tree/v0.6.1) (2014-07-03)
|
|
272
|
+
|
|
273
|
+
[Full Changelog](https://github.com/seuros/capistrano-puma/compare/v0.2.0...v0.6.1)
|
|
274
|
+
|
|
275
|
+
**Merged pull requests:**
|
|
276
|
+
|
|
277
|
+
- Explicitly daemonize when needed. [\#54](https://github.com/seuros/capistrano-puma/pull/54) ([crohr](https://github.com/crohr))
|
|
278
|
+
- Access and Error logs where backwards [\#52](https://github.com/seuros/capistrano-puma/pull/52) ([rottmanj](https://github.com/rottmanj))
|
|
279
|
+
- Fix jungle tasks [\#47](https://github.com/seuros/capistrano-puma/pull/47) ([RavWar](https://github.com/RavWar))
|
|
280
|
+
- Make monit play well with chruby. [\#46](https://github.com/seuros/capistrano-puma/pull/46) ([linjunpop](https://github.com/linjunpop))
|
|
281
|
+
- fix and beautify puma-deb, closes \#44 [\#45](https://github.com/seuros/capistrano-puma/pull/45) ([masterkain](https://github.com/masterkain))
|
|
282
|
+
- puma jungle start stop restart fix [\#38](https://github.com/seuros/capistrano-puma/pull/38) ([petertoth](https://github.com/petertoth))
|
|
283
|
+
- check redhat-release first [\#34](https://github.com/seuros/capistrano-puma/pull/34) ([marshall-lee](https://github.com/marshall-lee))
|
|
284
|
+
- set rack\_env before command execution [\#29](https://github.com/seuros/capistrano-puma/pull/29) ([arielze](https://github.com/arielze))
|
|
285
|
+
|
|
286
|
+
## [v0.2.0](https://github.com/seuros/capistrano-puma/tree/v0.2.0) (2014-01-28)
|
|
287
|
+
|
|
288
|
+
[Full Changelog](https://github.com/seuros/capistrano-puma/compare/4068552029ae7f40963afaa6d45d2877c7806d8d...v0.2.0)
|
|
289
|
+
|
|
290
|
+
**Merged pull requests:**
|
|
291
|
+
|
|
292
|
+
- add a trigger to puma config, for support Issue \#25 [\#26](https://github.com/seuros/capistrano-puma/pull/26) ([crhan](https://github.com/crhan))
|
|
293
|
+
- bump version for support capistrano v3.1 [\#24](https://github.com/seuros/capistrano-puma/pull/24) ([crhan](https://github.com/crhan))
|
|
294
|
+
- capistrano v3.1 compatible improve: dependency solve [\#22](https://github.com/seuros/capistrano-puma/pull/22) ([crhan](https://github.com/crhan))
|
|
295
|
+
- phased-restart also check for pid file first [\#21](https://github.com/seuros/capistrano-puma/pull/21) ([crhan](https://github.com/crhan))
|
|
296
|
+
- check pid instead of state file [\#20](https://github.com/seuros/capistrano-puma/pull/20) ([crhan](https://github.com/crhan))
|
|
297
|
+
- fix puma/puma\#300: Gemfile not refreshed between deploys [\#19](https://github.com/seuros/capistrano-puma/pull/19) ([crhan](https://github.com/crhan))
|
|
298
|
+
- Update README.md [\#17](https://github.com/seuros/capistrano-puma/pull/17) ([James-Hendrickson](https://github.com/James-Hendrickson))
|
|
299
|
+
- Sane defaults and puma:check [\#15](https://github.com/seuros/capistrano-puma/pull/15) ([shaneog](https://github.com/shaneog))
|
|
300
|
+
- run puma and pumactl with bundler [\#14](https://github.com/seuros/capistrano-puma/pull/14) ([ayamomiji](https://github.com/ayamomiji))
|
|
301
|
+
- Ensures that it will bundle w/ capistrano 3.1 [\#6](https://github.com/seuros/capistrano-puma/pull/6) ([kyledecot](https://github.com/kyledecot))
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
|
data/Gemfile
CHANGED
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,27 @@ To use customize environment variables
|
|
|
123
123
|
```
|
|
124
124
|
```ruby
|
|
125
125
|
set :puma_service_unit_env_vars, %w[
|
|
126
|
-
|
|
126
|
+
RAILS_ENV=development
|
|
127
127
|
PUMA_METRICS_HTTP=tcp://0.0.0.0:9393
|
|
128
128
|
]
|
|
129
129
|
```
|
|
130
130
|
|
|
131
|
+
### Systemd Socket Activation
|
|
132
|
+
|
|
133
|
+
Systemd socket activation starts your app upon first request if it is not already running
|
|
134
|
+
|
|
135
|
+
```ruby
|
|
136
|
+
set :puma_enable_socket_service, true
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
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).
|
|
140
|
+
|
|
141
|
+
To restart the listening socket using Systemd run
|
|
142
|
+
```
|
|
143
|
+
cap puma:systemd:restart_socket
|
|
144
|
+
```
|
|
145
|
+
This would also restart the puma instance as the puma service depends on the socket service being active
|
|
146
|
+
|
|
131
147
|
### Multi bind
|
|
132
148
|
|
|
133
149
|
Multi-bind can be set with an array in the puma_bind variable
|
|
@@ -3,7 +3,7 @@ module Capistrano
|
|
|
3
3
|
include PumaCommon
|
|
4
4
|
|
|
5
5
|
def register_hooks
|
|
6
|
-
after 'deploy:finished', 'puma:
|
|
6
|
+
after 'deploy:finished', 'puma:reload'
|
|
7
7
|
end
|
|
8
8
|
|
|
9
9
|
def define_tasks
|
|
@@ -13,9 +13,45 @@ 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_enable_socket_service, -> { false }
|
|
16
17
|
set_if_empty :puma_systemctl_user, :system
|
|
17
18
|
set_if_empty :puma_enable_lingering, -> { fetch(:puma_systemctl_user) != :system }
|
|
18
19
|
set_if_empty :puma_lingering_user, -> { fetch(:user) }
|
|
19
20
|
end
|
|
21
|
+
|
|
22
|
+
def expanded_bundle_command
|
|
23
|
+
backend.capture(:echo, SSHKit.config.command_map[:bundle]).strip
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def fetch_systemd_unit_path
|
|
27
|
+
if fetch(:puma_systemctl_user) == :system
|
|
28
|
+
"/etc/systemd/system/"
|
|
29
|
+
else
|
|
30
|
+
home_dir = backend.capture :pwd
|
|
31
|
+
File.join(home_dir, ".config", "systemd", "user")
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def systemd_command(*args)
|
|
36
|
+
command = [fetch(:puma_systemctl_bin)]
|
|
37
|
+
|
|
38
|
+
unless fetch(:puma_systemctl_user) == :system
|
|
39
|
+
command << "--user"
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
command + args
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def sudo_if_needed(*command)
|
|
46
|
+
if fetch(:puma_systemctl_user) == :system
|
|
47
|
+
backend.sudo command.map(&:to_s).join(" ")
|
|
48
|
+
else
|
|
49
|
+
backend.execute(*command)
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def execute_systemd(*args)
|
|
54
|
+
sudo_if_needed(*systemd_command(*args))
|
|
55
|
+
end
|
|
20
56
|
end
|
|
21
57
|
end
|
data/lib/capistrano/puma.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
require 'capistrano/bundler'
|
|
2
|
-
require
|
|
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
|
-
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
execute :loginctl, "enable-linger", fetch(:puma_lingering_user)
|
|
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,68 @@ namespace :puma do
|
|
|
36
56
|
desc 'Disable Puma systemd service'
|
|
37
57
|
task :disable do
|
|
38
58
|
on roles(fetch(:puma_role)) do
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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")
|
|
44
68
|
end
|
|
45
69
|
end
|
|
46
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
|
-
|
|
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
|
-
|
|
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))
|
|
68
90
|
end
|
|
69
91
|
end
|
|
70
92
|
|
|
71
93
|
desc 'Restart Puma service via systemd'
|
|
72
94
|
task :restart do
|
|
73
95
|
on roles(fetch(:puma_role)) do
|
|
74
|
-
|
|
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
|
|
96
|
+
git_plugin.execute_systemd("restart", fetch(:puma_service_unit_name))
|
|
79
97
|
end
|
|
80
98
|
end
|
|
81
99
|
|
|
82
|
-
desc '
|
|
83
|
-
task :
|
|
100
|
+
desc 'Reload Puma service via systemd'
|
|
101
|
+
task :reload do
|
|
84
102
|
on roles(fetch(:puma_role)) do
|
|
103
|
+
service_ok = execute("#{fetch(:puma_systemctl_bin)} --user status #{fetch(:puma_service_unit_name)} > /dev/null", raise_on_non_zero_exit: false)
|
|
104
|
+
cmd = 'reload'
|
|
105
|
+
if !service_ok
|
|
106
|
+
cmd = 'restart'
|
|
107
|
+
end
|
|
85
108
|
if fetch(:puma_systemctl_user) == :system
|
|
86
|
-
sudo "#{fetch(:puma_systemctl_bin)}
|
|
109
|
+
sudo "#{fetch(:puma_systemctl_bin)} #{cmd} #{fetch(:puma_service_unit_name)}"
|
|
87
110
|
else
|
|
88
|
-
execute "#{fetch(:puma_systemctl_bin)}", "--user",
|
|
111
|
+
execute "#{fetch(:puma_systemctl_bin)}", "--user", cmd, fetch(:puma_service_unit_name)
|
|
89
112
|
end
|
|
90
113
|
end
|
|
91
114
|
end
|
|
92
115
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
File.join(home_dir, ".config", "systemd", "user")
|
|
116
|
+
desc 'Get Puma service status via systemd'
|
|
117
|
+
task :status do
|
|
118
|
+
on roles(fetch(:puma_role)) do
|
|
119
|
+
git_plugin.execute_systemd("status", fetch(:puma_service_unit_name))
|
|
120
|
+
git_plugin.execute_systemd("status", fetch(:puma_service_unit_name) + ".socket") if fetch(:puma_enable_socket_service)
|
|
99
121
|
end
|
|
100
122
|
end
|
|
101
|
-
|
|
102
123
|
end
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
upstream puma_<%= fetch(:nginx_config_name) %> { <%
|
|
2
|
-
@backends =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
10
|
-
|
|
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
|
|
4
|
+
version: 5.1.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-
|
|
11
|
+
date: 2021-09-02 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
|