pixelforce_recipes 1.6 → 1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile.lock +12 -12
- data/README.md +33 -1
- data/lib/pixelforce_recipes.rb +3 -2
- data/lib/pixelforce_recipes/capistrano_3_recipes/puma.rb +52 -11
- data/lib/pixelforce_recipes/capistrano_3_recipes/resque.rb +32 -11
- data/lib/pixelforce_recipes/capistrano_3_recipes/resque_scheduler.rb +32 -11
- data/lib/pixelforce_recipes/capistrano_3_recipes/sidekiq.rb +32 -11
- data/lib/pixelforce_recipes/capistrano_3_recipes/supervisor.rb +9 -0
- data/lib/pixelforce_recipes/capistrano_3_recipes/unicorn.rb +47 -13
- data/lib/pixelforce_recipes/templates/nginx_puma_config.erb +1 -1
- data/lib/pixelforce_recipes/templates/puma.rb.erb +34 -0
- data/lib/pixelforce_recipes/templates/puma_init.erb +4 -4
- data/lib/pixelforce_recipes/templates/puma_supervisor.erb +13 -0
- data/lib/pixelforce_recipes/templates/resque_init.erb +2 -2
- data/lib/pixelforce_recipes/templates/resque_scheduler_init.erb +2 -2
- data/lib/pixelforce_recipes/templates/resque_scheduler_supervisor.erb +12 -0
- data/lib/pixelforce_recipes/templates/resque_supervisor.erb +12 -0
- data/lib/pixelforce_recipes/templates/sidekiq_init.erb +1 -1
- data/lib/pixelforce_recipes/templates/sidekiq_supervisor.erb +12 -0
- data/lib/pixelforce_recipes/templates/supervisor.erb +19 -0
- data/lib/pixelforce_recipes/templates/unicorn_supervisor.erb +13 -0
- data/lib/pixelforce_recipes/version.rb +1 -1
- data/pixelforce_recipes.gemspec +1 -1
- metadata +13 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e2f2bb680c8a781970d5d1889b4f7c3107242c8b3052ed4f07d896e76236307e
|
4
|
+
data.tar.gz: c41a8ae182ca17398dda97f95dbf70d9c9407b7f75ce78cc74ae8be994350f95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfc18005e3be92d5699e4f0e31abf1bff6db288102c8e5694c2f1bde806df281725f4febde50fa01988bb56362eefdc52cb258386bdc1275431b137e1ebe7e6d
|
7
|
+
data.tar.gz: cc309a15f2b368d17903742bcbd1ee1a6f31bbf6011dcac72a1f0231c23ab27cec813d9302cb5a8315f0ff1999cddc1f368c5b7f675d26466f44b5ae1898e954
|
data/Gemfile.lock
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
pixelforce_recipes (1.
|
4
|
+
pixelforce_recipes (1.8)
|
5
5
|
capistrano (> 2.0.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
airbrussh (1.
|
10
|
+
airbrussh (1.4.0)
|
11
11
|
sshkit (>= 1.6.1, != 1.7.0)
|
12
|
-
capistrano (3.
|
12
|
+
capistrano (3.12.0)
|
13
13
|
airbrussh (>= 1.0.0)
|
14
14
|
i18n
|
15
15
|
rake (>= 10.0.0)
|
16
16
|
sshkit (>= 1.9.0)
|
17
|
-
concurrent-ruby (1.1.
|
17
|
+
concurrent-ruby (1.1.6)
|
18
18
|
diff-lcs (1.2.5)
|
19
|
-
i18n (1.
|
19
|
+
i18n (1.8.2)
|
20
20
|
concurrent-ruby (~> 1.0)
|
21
|
-
net-scp (
|
22
|
-
net-ssh (>= 2.6.5)
|
23
|
-
net-ssh (5.0
|
24
|
-
rake (
|
21
|
+
net-scp (2.0.0)
|
22
|
+
net-ssh (>= 2.6.5, < 6.0.0)
|
23
|
+
net-ssh (5.2.0)
|
24
|
+
rake (13.0.1)
|
25
25
|
rspec (3.5.0)
|
26
26
|
rspec-core (~> 3.5.0)
|
27
27
|
rspec-expectations (~> 3.5.0)
|
@@ -35,7 +35,7 @@ GEM
|
|
35
35
|
diff-lcs (>= 1.2.0, < 2.0)
|
36
36
|
rspec-support (~> 3.5.0)
|
37
37
|
rspec-support (3.5.0)
|
38
|
-
sshkit (1.
|
38
|
+
sshkit (1.20.0)
|
39
39
|
net-scp (>= 1.1.2)
|
40
40
|
net-ssh (>= 2.8.0)
|
41
41
|
|
@@ -45,8 +45,8 @@ PLATFORMS
|
|
45
45
|
DEPENDENCIES
|
46
46
|
bundler (~> 1.12)
|
47
47
|
pixelforce_recipes!
|
48
|
-
rake (~>
|
48
|
+
rake (~> 13.0)
|
49
49
|
rspec (~> 3.0)
|
50
50
|
|
51
51
|
BUNDLED WITH
|
52
|
-
1.
|
52
|
+
1.16.6
|
data/README.md
CHANGED
@@ -34,8 +34,40 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
34
34
|
|
35
35
|
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/pixelforce_recipes. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
36
36
|
|
37
|
+
## supervisor support
|
38
|
+
|
39
|
+
The recipes for capistrano3 with supervisor support.
|
40
|
+
Please use `process:supervisor:task` to invoke it.
|
41
|
+
They relied on some capistrano plugins for some variables
|
42
|
+
|
43
|
+
* [**rvm**](https://github.com/capistrano/rvm) for `rvm_ruby_version`
|
44
|
+
|
45
|
+
Tweak some option for supervisor, the following value is default
|
46
|
+
|
47
|
+
```ruby
|
48
|
+
set :autostart, 'true'
|
49
|
+
set :autorestart, 'true'
|
50
|
+
set :logfile_maxbytes, '1GB'
|
51
|
+
set :logfile_backups, '10'
|
52
|
+
```
|
53
|
+
|
54
|
+
#### unicorn
|
55
|
+
|
56
|
+
Relied on unicornherder for supervisor monitoring.
|
57
|
+
|
58
|
+
#### puma
|
59
|
+
|
60
|
+
Get rid of capistrano-puma, and now generate puma config itself.
|
61
|
+
|
62
|
+
```ruby
|
63
|
+
set :puma_threads, [0, 1]
|
64
|
+
set :puma_workers, 2
|
65
|
+
```
|
66
|
+
|
67
|
+
## sysvinit support
|
68
|
+
|
69
|
+
Please use `process:sysvinit:task` to invoke it.
|
37
70
|
|
38
71
|
## License
|
39
72
|
|
40
73
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
41
|
-
|
data/lib/pixelforce_recipes.rb
CHANGED
@@ -6,7 +6,8 @@ if defined?(Capistrano::VERSION)
|
|
6
6
|
require File.expand_path("#{File.dirname(__FILE__)}/pixelforce_recipes/capistrano_3_recipes/base")
|
7
7
|
require File.expand_path("#{File.dirname(__FILE__)}/pixelforce_recipes/capistrano_3_recipes/sidekiq")
|
8
8
|
require File.expand_path("#{File.dirname(__FILE__)}/pixelforce_recipes/capistrano_3_recipes/resque")
|
9
|
-
require File.expand_path("#{File.dirname(__FILE__)}/pixelforce_recipes/capistrano_3_recipes/
|
9
|
+
require File.expand_path("#{File.dirname(__FILE__)}/pixelforce_recipes/capistrano_3_recipes/resque_scheduler")
|
10
|
+
require File.expand_path("#{File.dirname(__FILE__)}/pixelforce_recipes/capistrano_3_recipes/supervisor")
|
10
11
|
require File.expand_path("#{File.dirname(__FILE__)}/pixelforce_recipes/capistrano_3_recipes/unicorn")
|
11
12
|
require File.expand_path("#{File.dirname(__FILE__)}/pixelforce_recipes/capistrano_3_recipes/puma")
|
12
13
|
else
|
@@ -17,4 +18,4 @@ if defined?(Capistrano::VERSION)
|
|
17
18
|
require File.expand_path("#{File.dirname(__FILE__)}/pixelforce_recipes/legacy_recipes/puma")
|
18
19
|
require File.expand_path("#{File.dirname(__FILE__)}/pixelforce_recipes/legacy_recipes/logrotate")
|
19
20
|
end
|
20
|
-
end
|
21
|
+
end
|
@@ -1,22 +1,63 @@
|
|
1
1
|
namespace :puma do
|
2
2
|
|
3
3
|
desc "Setup puma configuration for this application"
|
4
|
-
task :
|
4
|
+
task :config do
|
5
5
|
on roles(:web) do
|
6
|
-
template "
|
7
|
-
sudo "mv /tmp/
|
8
|
-
sudo "chmod +x /etc/init.d/#{fetch(:application)}"
|
9
|
-
sudo "update-rc.d #{fetch(:application)} defaults"
|
10
|
-
template "nginx_puma_config.erb", "/tmp/nginx_puma_config"
|
11
|
-
sudo "mv /tmp/nginx_puma_config /etc/nginx/sites-enabled/#{fetch(:application)}"
|
6
|
+
template "puma.rb.erb", "/tmp/puma_conf"
|
7
|
+
sudo "mv /tmp/puma_conf #{shared_path}/config"
|
12
8
|
end
|
13
9
|
end
|
10
|
+
namespace :sysvinit do
|
11
|
+
task :setup do
|
12
|
+
on roles(:web) do
|
13
|
+
template "puma_init.erb", "/tmp/puma"
|
14
|
+
sudo "mv /tmp/puma /etc/init.d/#{fetch(:application)}"
|
15
|
+
sudo "chmod +x /etc/init.d/#{fetch(:application)}"
|
16
|
+
sudo "update-rc.d #{fetch(:application)} defaults"
|
17
|
+
template "nginx_puma_config.erb", "/tmp/nginx_puma_config"
|
18
|
+
sudo "mv /tmp/nginx_puma_config /etc/nginx/sites-enabled/#{fetch(:application)}"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
%w[start stop restart reload].each do |command|
|
23
|
+
desc "#{command} puma"
|
24
|
+
task command do
|
25
|
+
on roles(:web) do
|
26
|
+
execute "/etc/init.d/#{fetch(:application)} #{command}"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
namespace :supervisor do
|
32
|
+
task :setup do
|
33
|
+
on roles(:web) do
|
34
|
+
template "puma_supervisor.erb", "/tmp/puma"
|
35
|
+
sudo "mv /tmp/puma /etc/supervisor/conf.d/#{fetch(:application)}"
|
36
|
+
sudo "supervisorctl reread"
|
37
|
+
sudo "supervisorctl update" # it will auto start the application
|
38
|
+
template "nginx_puma_config.erb", "/tmp/nginx_puma_config"
|
39
|
+
sudo "mv /tmp/nginx_puma_config /etc/nginx/sites-enabled/#{fetch(:application)}"
|
40
|
+
end
|
41
|
+
end
|
14
42
|
|
15
|
-
|
16
|
-
|
17
|
-
|
43
|
+
task :start do
|
44
|
+
on roles(:web) do
|
45
|
+
execute "supervisorctl start #{fetch(:application)}"
|
46
|
+
end
|
47
|
+
end
|
48
|
+
task :stop do
|
49
|
+
on roles(:web) do
|
50
|
+
execute "supervisorctl signal INT #{fetch(:application)}"
|
51
|
+
end
|
52
|
+
end
|
53
|
+
task :restart do
|
54
|
+
on roles(:web) do
|
55
|
+
execute "supervisorctl signal USR1 #{fetch(:application)}"
|
56
|
+
end
|
57
|
+
end
|
58
|
+
task :reload do
|
18
59
|
on roles(:web) do
|
19
|
-
execute "
|
60
|
+
execute "supervisorctl signal USR2 #{fetch(:application)}"
|
20
61
|
end
|
21
62
|
end
|
22
63
|
end
|
@@ -2,20 +2,41 @@ namespace :resque do
|
|
2
2
|
desc "Install resque"
|
3
3
|
|
4
4
|
desc "Setup resque configuration for this application"
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
5
|
+
namespace :sysvinit do
|
6
|
+
task :setup do
|
7
|
+
on roles(:resque) do
|
8
|
+
template "resque_init.erb", "/tmp/resque"
|
9
|
+
sudo "mv /tmp/resque /etc/init.d/resque"
|
10
|
+
sudo "chmod +x /etc/init.d/resque"
|
11
|
+
sudo "update-rc.d resque defaults"
|
12
|
+
end
|
11
13
|
end
|
12
|
-
end
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
15
|
+
%w[start stop restart].each do |command|
|
16
|
+
desc "#{command} resque"
|
17
|
+
task command do
|
18
|
+
on roles(:resque) do
|
19
|
+
execute "/etc/init.d/resque #{command}"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
namespace :supervisor do
|
25
|
+
task :setup do
|
17
26
|
on roles(:resque) do
|
18
|
-
|
27
|
+
template "resque_supervisor.erb", "/tmp/resque"
|
28
|
+
sudo "mv /tmp/resque /etc/supervisor/conf.d/resque"
|
29
|
+
sudo "supervisorctl reread"
|
30
|
+
sudo "supervisorctl update" # it will auto start the application
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
%w[start stop restart].each do |command|
|
35
|
+
desc "#{command} resque"
|
36
|
+
task command do
|
37
|
+
on roles(:resque) do
|
38
|
+
execute "supervisorctl #{command} resque"
|
39
|
+
end
|
19
40
|
end
|
20
41
|
end
|
21
42
|
end
|
@@ -2,20 +2,41 @@ namespace :resque_scheduler do
|
|
2
2
|
desc "Install resque scheduler"
|
3
3
|
|
4
4
|
desc "Setup resque scheduler configuration for this application"
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
5
|
+
namespace :sysvinit do
|
6
|
+
task :setup do
|
7
|
+
on roles(:resque) do
|
8
|
+
template "resque_scheduler_init.erb", "/tmp/resque_scheduler"
|
9
|
+
sudo "mv /tmp/resque_scheduler /etc/init.d/resque_scheduler"
|
10
|
+
sudo "chmod +x /etc/init.d/resque_scheduler"
|
11
|
+
sudo "update-rc.d resque_scheduler defaults"
|
12
|
+
end
|
11
13
|
end
|
12
|
-
end
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
15
|
+
%w[start stop restart].each do |command|
|
16
|
+
desc "#{command} resque_scheduler"
|
17
|
+
task command do
|
18
|
+
on roles(:resque) do
|
19
|
+
execute "/etc/init.d/resque_scheduler #{command}"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
namespace :supervisor do
|
25
|
+
task :setup do
|
17
26
|
on roles(:resque) do
|
18
|
-
|
27
|
+
template "resque_scheduler_supervisor.erb", "/tmp/resque_scheduler"
|
28
|
+
sudo "mv /tmp/resque_scheduler /etc/supervisor/conf.d/resque_scheduler"
|
29
|
+
sudo "supervisorctl reread"
|
30
|
+
sudo "supervisorctl update" # it will auto start the application
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
%w[start stop restart].each do |command|
|
35
|
+
desc "#{command} resque_scheduler"
|
36
|
+
task command do
|
37
|
+
on roles(:resque) do
|
38
|
+
execute "supervisorctl #{command} resque_scheduler"
|
39
|
+
end
|
19
40
|
end
|
20
41
|
end
|
21
42
|
end
|
@@ -2,20 +2,41 @@ namespace :sidekiq do
|
|
2
2
|
desc "Install sidekiq"
|
3
3
|
|
4
4
|
desc "Setup sidekiq configuration for this application"
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
5
|
+
namespace :sysvinit do
|
6
|
+
task :setup do
|
7
|
+
on roles(:sidekiq) do
|
8
|
+
template "sidekiq_init.erb", "/tmp/sidekiq"
|
9
|
+
sudo "mv /tmp/sidekiq /etc/init.d/sidekiq"
|
10
|
+
sudo "chmod +x /etc/init.d/sidekiq"
|
11
|
+
sudo "update-rc.d sidekiq defaults"
|
12
|
+
end
|
11
13
|
end
|
12
|
-
end
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
15
|
+
%w[start stop restart].each do |command|
|
16
|
+
desc "#{command} sidekiq"
|
17
|
+
task command do
|
18
|
+
on roles(:sidekiq) do
|
19
|
+
execute "/etc/init.d/sidekiq #{command}"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
namespace :supervisor do
|
25
|
+
task :setup do
|
17
26
|
on roles(:sidekiq) do
|
18
|
-
|
27
|
+
template "sidekiq_supervisor.erb", "/tmp/sidekiq"
|
28
|
+
sudo "mv /tmp/sidekiq /etc/supervisor/conf.d/sidekiq"
|
29
|
+
sudo "supervisorctl reread"
|
30
|
+
sudo "supervisorctl update" # it will auto start the application
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
%w[start stop restart].each do |command|
|
35
|
+
desc "#{command} sidekiq"
|
36
|
+
task command do
|
37
|
+
on roles(:sidekiq) do
|
38
|
+
execute "supervisorctl #{command} sidekiq"
|
39
|
+
end
|
19
40
|
end
|
20
41
|
end
|
21
42
|
end
|
@@ -1,23 +1,57 @@
|
|
1
1
|
namespace :unicorn do
|
2
2
|
desc "Install unicorn"
|
3
|
+
namespace :sysvinit do
|
4
|
+
task :setup do
|
5
|
+
on roles(:web) do
|
6
|
+
template "unicorn_init.erb", "/tmp/unicorn"
|
7
|
+
sudo "mv /tmp/unicorn /etc/init.d/#{fetch(:application)}"
|
8
|
+
sudo "chmod +x /etc/init.d/#{fetch(:application)}"
|
9
|
+
sudo "update-rc.d #{fetch(:application)} defaults"
|
10
|
+
template "nginx_config.erb", "/tmp/nginx_config"
|
11
|
+
sudo "mv /tmp/nginx_config /etc/nginx/sites-enabled/#{fetch(:application)}"
|
12
|
+
end
|
13
|
+
end
|
3
14
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
template "nginx_config.erb", "/tmp/nginx_config"
|
12
|
-
sudo "mv /tmp/nginx_config /etc/nginx/sites-enabled/#{fetch(:application)}"
|
15
|
+
%w[start stop restart reload].each do |command|
|
16
|
+
desc "#{command} unicorn"
|
17
|
+
task command do
|
18
|
+
on roles(:web) do
|
19
|
+
execute "/etc/init.d/#{fetch(:application)} #{command}"
|
20
|
+
end
|
21
|
+
end
|
13
22
|
end
|
14
23
|
end
|
24
|
+
namespace :supervisor do
|
25
|
+
desc "Setup unicorn configuration for this application"
|
26
|
+
task :setup do
|
27
|
+
on roles(:web) do
|
28
|
+
template "unicorn_supervisor.erb", "/tmp/unicorn"
|
29
|
+
sudo "mv /tmp/unicorn /etc/supervisor/conf.d/#{fetch(:application)}"
|
30
|
+
sudo "supervisorctl reread"
|
31
|
+
sudo "supervisorctl update" # it will auto start the application
|
32
|
+
template "nginx_config.erb", "/tmp/nginx_config"
|
33
|
+
sudo "mv /tmp/nginx_config /etc/nginx/sites-enabled/#{fetch(:application)}"
|
34
|
+
end
|
35
|
+
end
|
15
36
|
|
16
|
-
|
17
|
-
|
18
|
-
|
37
|
+
task :start do
|
38
|
+
on roles(:web) do
|
39
|
+
execute "supervisorctl start #{fetch(:application)}"
|
40
|
+
end
|
41
|
+
end
|
42
|
+
task :stop do
|
43
|
+
on roles(:web) do
|
44
|
+
execute "supervisorctl signal QUIT #{fetch(:application)}"
|
45
|
+
end
|
46
|
+
end
|
47
|
+
task :restart do
|
48
|
+
on roles(:web) do
|
49
|
+
execute "supervisorctl signal USR2 #{fetch(:application)}"
|
50
|
+
end
|
51
|
+
end
|
52
|
+
task :reload do
|
19
53
|
on roles(:web) do
|
20
|
-
execute "
|
54
|
+
execute "supervisorctl signal HUP #{fetch(:application)}"
|
21
55
|
end
|
22
56
|
end
|
23
57
|
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
#!/usr/bin/env puma
|
2
|
+
|
3
|
+
directory '<%= current_path %>'
|
4
|
+
rackup "#{current_path}/config.ru"
|
5
|
+
environment '<%= fetch(:rails_env, 'production') %>'
|
6
|
+
tag '<%= fetch(:application)%>'
|
7
|
+
pidfile "#{shared_path}/pids/puma.pid"
|
8
|
+
state_path "#{shared_path}/pids/puma.state"
|
9
|
+
stdout_redirect "#{shared_path}/log/puma_access.log", "#{shared_path}/log/puma_error.log", true
|
10
|
+
|
11
|
+
threads <%= fetch(:puma_threads, [0, 1]).join(',')%>
|
12
|
+
|
13
|
+
bind "unix:///tmp/<%= fetch(:application)%>.sock"
|
14
|
+
|
15
|
+
activate_control_app "unix://#{shared_path}/tmp/sockets/pumactl.sock"
|
16
|
+
|
17
|
+
workers <%= fetch(:puma_workers, 2) %>
|
18
|
+
|
19
|
+
preload_app!
|
20
|
+
|
21
|
+
on_restart do
|
22
|
+
puts 'Refreshing Gemfile'
|
23
|
+
ENV["BUNDLE_GEMFILE"] = "<%= fetch(:bundle_gemfile, "#{current_path}/Gemfile") %>"
|
24
|
+
end
|
25
|
+
|
26
|
+
before_fork do
|
27
|
+
ActiveRecord::Base.connection_pool.disconnect!
|
28
|
+
end
|
29
|
+
|
30
|
+
on_worker_boot do
|
31
|
+
ActiveSupport.on_load(:active_record) do
|
32
|
+
ActiveRecord::Base.establish_connection
|
33
|
+
end
|
34
|
+
end
|
@@ -13,7 +13,7 @@
|
|
13
13
|
USER="<%= fetch(:user) %>"
|
14
14
|
DAEMON=puma
|
15
15
|
PROJECT_PATH="<%= fetch(:deploy_to) %>"
|
16
|
-
DAEMON_OPTS="-e <%= fetch(:rails_env) %> -d"
|
16
|
+
DAEMON_OPTS="-C $PROJECT_PATH/shared/config/puma.rb -e <%= fetch(:rails_env) %> -d"
|
17
17
|
NAME=puma
|
18
18
|
DESC="puma app for $USER"
|
19
19
|
PID="$PROJECT_PATH/shared/pids/puma.pid"
|
@@ -33,17 +33,17 @@ case "$1" in
|
|
33
33
|
;;
|
34
34
|
stop)
|
35
35
|
echo -n "Stopping $DESC: "
|
36
|
-
kill -
|
36
|
+
kill -INT `cat $PID`
|
37
37
|
echo "$NAME."
|
38
38
|
;;
|
39
39
|
restart)
|
40
40
|
echo -n "Restarting $DESC: "
|
41
|
-
kill -
|
41
|
+
kill -USR1 `cat $PID`
|
42
42
|
echo "$NAME."
|
43
43
|
;;
|
44
44
|
reload)
|
45
45
|
echo -n "Reloading $DESC configuration: "
|
46
|
-
kill -
|
46
|
+
kill -USR2 `cat $PID`
|
47
47
|
echo "$NAME."
|
48
48
|
;;
|
49
49
|
*)
|
@@ -0,0 +1,13 @@
|
|
1
|
+
[program:<%= fetch(:application) %>]
|
2
|
+
user=<%= fetch(:user) %>
|
3
|
+
environment=HOME="/home/<%= fetch(:user) %>",USER="<%= fetch(:user) %>"
|
4
|
+
directory=<%= fetch(:deploy_to) %>/current
|
5
|
+
command=/home/<%= fetch(:user) %>/.rvm/bin/rvm <%= fetch(:rvm_ruby_version, '2.4.7') %> do bundle exec puma -C <%= fetch(:deploy_to) %>/shared/config/puma.rb -e <%= fetch(:rails_env) %>
|
6
|
+
autostart=<%= fetch(:autostart, 'true') %>
|
7
|
+
autorestart=<%= fetch(:autorestart, 'true') %>
|
8
|
+
startsecs=5
|
9
|
+
startretries=3
|
10
|
+
stderr_logfile=<%= fetch(:deploy_to) %>/shared/log/puma.error.log
|
11
|
+
stdout_logfile=<%= fetch(:deploy_to) %>/shared/log/puma.access.log
|
12
|
+
stdout_logfile_maxbytes=<%= fetch(:logfile_maxbytes, '5GB') %>
|
13
|
+
stdout_logfile_backups=<%= fetch(:logfile_backups, '10') %>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
# Description: starts resque
|
11
11
|
### END INIT INFO
|
12
12
|
|
13
|
-
USER="
|
13
|
+
USER="<%= fetch(:user) %>"
|
14
14
|
PROJECT_PATH="<%= fetch(:deploy_to) %>"
|
15
15
|
NAME=resque
|
16
16
|
DESC="Resque app for $USER"
|
@@ -46,4 +46,4 @@ case "$1" in
|
|
46
46
|
;;
|
47
47
|
esac
|
48
48
|
|
49
|
-
exit 0
|
49
|
+
exit 0
|
@@ -10,7 +10,7 @@
|
|
10
10
|
# Description: starts resque scheduler
|
11
11
|
### END INIT INFO
|
12
12
|
|
13
|
-
USER="
|
13
|
+
USER="<%= fetch(:user) %>"
|
14
14
|
PROJECT_PATH="<%= fetch(:deploy_to) %>"
|
15
15
|
NAME="resque_scheduler"
|
16
16
|
DESC="Resque Scheduler for $USER"
|
@@ -46,4 +46,4 @@ case "$1" in
|
|
46
46
|
;;
|
47
47
|
esac
|
48
48
|
|
49
|
-
exit 0
|
49
|
+
exit 0
|
@@ -0,0 +1,12 @@
|
|
1
|
+
[program:resque_scheduler]
|
2
|
+
user=<%= fetch(:user) %>
|
3
|
+
environment=HOME="/home/<%= fetch(:user) %>",USER="<%= fetch(:user) %>"
|
4
|
+
directory=<%= fetch(:deploy_to) %>/current
|
5
|
+
command=/home/<%= fetch(:user) %>/.rvm/bin/rvm <%= fetch(:rvm_ruby_version, '2.4.7') %> do bundle exec rake RAILS_ENV=<%= fetch(:rails_env) %> QUEUE='*' environment resque:scheduler 2>&1 > <%= fetch(:deploy_to) %>/shared/log/resque_scheduler.log
|
6
|
+
autostart=<%= fetch(:autostart, 'true') %>
|
7
|
+
autorestart=<%= fetch(:autorestart, 'true') %>
|
8
|
+
startsecs=5
|
9
|
+
startretries=3
|
10
|
+
stdout_logfile=<%= fetch(:deploy_to) %>/shared/log/resque_scheduler.log
|
11
|
+
stdout_logfile_maxbytes=<%= fetch(:logfile_maxbytes, '1GB') %>
|
12
|
+
stdout_logfile_backups=<%= fetch(:logfile_backups, '10') %>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
[program:resque]
|
2
|
+
user=<%= fetch(:user) %>
|
3
|
+
environment=HOME="/home/<%= fetch(:user) %>",USER="<%= fetch(:user) %>"
|
4
|
+
directory=<%= fetch(:deploy_to) %>/current
|
5
|
+
command=/home/<%= fetch(:user) %>/.rvm/bin/rvm <%= fetch(:rvm_ruby_version, '2.4.7') %> do bundle exec rake RAILS_ENV=<%= fetch(:rails_env) %> QUEUE=critical,default,mailers,low environment resque:work 2>&1 > <%= fetch(:deploy_to) %>/shared/log/resque.log
|
6
|
+
autostart=<%= fetch(:autostart, 'true') %>
|
7
|
+
autorestart=<%= fetch(:autorestart, 'true') %>
|
8
|
+
startsecs=5
|
9
|
+
startretries=3
|
10
|
+
stdout_logfile=<%= fetch(:deploy_to) %>/shared/log/resque.log
|
11
|
+
stdout_logfile_maxbytes=<%= fetch(:logfile_maxbytes, '1GB') %>
|
12
|
+
stdout_logfile_backups=<%= fetch(:logfile_backups, '10') %>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
[program:sidekiq]
|
2
|
+
user=<%= fetch(:user) %>
|
3
|
+
environment=HOME="/home/<%= fetch(:user) %>",USER="<%= fetch(:user) %>"
|
4
|
+
directory=<%= fetch(:deploy_to) %>/current
|
5
|
+
command=/home/<%= fetch(:user) %>/.rvm/bin/rvm <%= fetch(:rvm_ruby_version, '2.4.7') %> do bundle exec sidekiq -L <%= fetch(:deploy_to) %>/shared/log/sidekiq.log -e <%= fetch(:rails_env) %>
|
6
|
+
autostart=<%= fetch(:autostart, 'true') %>
|
7
|
+
autorestart=<%= fetch(:autorestart, 'true') %>
|
8
|
+
startsecs=5
|
9
|
+
startretries=3
|
10
|
+
stdout_logfile=<%= fetch(:deploy_to) %>/shared/log/sidekiq.log
|
11
|
+
stdout_logfile_maxbytes=<%= fetch(:logfile_maxbytes, '1GB') %>
|
12
|
+
stdout_logfile_backups=<%= fetch(:logfile_backups, '10') %>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
; Generated with pixelforce recipies
|
2
|
+
[unix_http_server]
|
3
|
+
file=/tmp/supervisor.sock ; (the path to the socket file)
|
4
|
+
chmod=0700 ; sockef file mode (default 0700)
|
5
|
+
|
6
|
+
[supervisord]
|
7
|
+
user=<%= fetch(:user) %>
|
8
|
+
logfile=/tmp/supervisord.log ; (main log file;default $CWD/supervisord.log)
|
9
|
+
pidfile=/tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
|
10
|
+
|
11
|
+
[rpcinterface:supervisor]
|
12
|
+
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
13
|
+
|
14
|
+
[supervisorctl]
|
15
|
+
serverurl=unix:///tmp/supervisor.sock
|
16
|
+
|
17
|
+
[include]
|
18
|
+
files = /etc/supervisor/conf.d/*.conf
|
19
|
+
|
@@ -0,0 +1,13 @@
|
|
1
|
+
[program:<%= fetch(:application) %>]
|
2
|
+
user=<%= fetch(:user) %>
|
3
|
+
environment=HOME="/home/<%= fetch(:user) %>",USER="<%= fetch(:user) %>"
|
4
|
+
directory=<%= fetch(:deploy_to) %>/current
|
5
|
+
command=/home/<%= fetch(:user) %>/.rvm/bin/rvm <%= fetch(:rvm_ruby_version, '2.4.7') %> do bundle exec unicornherder -u unicorn -p <%= fetch(:deploy_to) %>/shared/pids/unicorn.pid -- -c config/unicorn.rb -E <%= fetch(:rails_env) %>
|
6
|
+
autostart=<%= fetch(:autostart, 'true') %>
|
7
|
+
autorestart=<%= fetch(:autorestart, 'true') %>
|
8
|
+
startsecs=5
|
9
|
+
startretries=3
|
10
|
+
stderr_logfile=<%= fetch(:deploy_to) %>/shared/log/<%= fetch(:application) %>.log
|
11
|
+
stdout_logfile=<%= fetch(:deploy_to) %>/shared/log/<%= fetch(:rails_env) %>.log
|
12
|
+
stdout_logfile_maxbytes=<%= fetch(:logfile_maxbytes, '5GB') %>
|
13
|
+
stdout_logfile_backups=<%= fetch(:logfile_backups, '10') %>
|
data/pixelforce_recipes.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
22
|
spec.add_development_dependency "bundler", "~> 1.12"
|
23
|
-
spec.add_development_dependency "rake", "~>
|
23
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
24
24
|
spec.add_development_dependency "rspec", "~> 3.0"
|
25
25
|
spec.add_dependency(%q<capistrano>, ["> 2.0.0"])
|
26
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pixelforce_recipes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.8'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Zhang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '13.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '13.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -89,6 +89,7 @@ files:
|
|
89
89
|
- lib/pixelforce_recipes/capistrano_3_recipes/resque.rb
|
90
90
|
- lib/pixelforce_recipes/capistrano_3_recipes/resque_scheduler.rb
|
91
91
|
- lib/pixelforce_recipes/capistrano_3_recipes/sidekiq.rb
|
92
|
+
- lib/pixelforce_recipes/capistrano_3_recipes/supervisor.rb
|
92
93
|
- lib/pixelforce_recipes/capistrano_3_recipes/unicorn.rb
|
93
94
|
- lib/pixelforce_recipes/legacy_recipes/base.rb
|
94
95
|
- lib/pixelforce_recipes/legacy_recipes/logrotate.rb
|
@@ -100,11 +101,18 @@ files:
|
|
100
101
|
- lib/pixelforce_recipes/templates/logrotate.erb
|
101
102
|
- lib/pixelforce_recipes/templates/nginx_config.erb
|
102
103
|
- lib/pixelforce_recipes/templates/nginx_puma_config.erb
|
104
|
+
- lib/pixelforce_recipes/templates/puma.rb.erb
|
103
105
|
- lib/pixelforce_recipes/templates/puma_init.erb
|
106
|
+
- lib/pixelforce_recipes/templates/puma_supervisor.erb
|
104
107
|
- lib/pixelforce_recipes/templates/resque_init.erb
|
105
108
|
- lib/pixelforce_recipes/templates/resque_scheduler_init.erb
|
109
|
+
- lib/pixelforce_recipes/templates/resque_scheduler_supervisor.erb
|
110
|
+
- lib/pixelforce_recipes/templates/resque_supervisor.erb
|
106
111
|
- lib/pixelforce_recipes/templates/sidekiq_init.erb
|
112
|
+
- lib/pixelforce_recipes/templates/sidekiq_supervisor.erb
|
113
|
+
- lib/pixelforce_recipes/templates/supervisor.erb
|
107
114
|
- lib/pixelforce_recipes/templates/unicorn_init.erb
|
115
|
+
- lib/pixelforce_recipes/templates/unicorn_supervisor.erb
|
108
116
|
- lib/pixelforce_recipes/version.rb
|
109
117
|
- pixelforce_recipes.gemspec
|
110
118
|
homepage: https://git.pixelforcesystems.com.au/
|
@@ -127,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
135
|
version: '0'
|
128
136
|
requirements: []
|
129
137
|
rubyforge_project:
|
130
|
-
rubygems_version: 2.
|
138
|
+
rubygems_version: 2.7.9
|
131
139
|
signing_key:
|
132
140
|
specification_version: 4
|
133
141
|
summary: Write a short summary, because Rubygems requires one.
|