pixelforce_recipes 1.8 → 2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e2f2bb680c8a781970d5d1889b4f7c3107242c8b3052ed4f07d896e76236307e
4
- data.tar.gz: c41a8ae182ca17398dda97f95dbf70d9c9407b7f75ce78cc74ae8be994350f95
3
+ metadata.gz: 4cc8944ed978b04a14ad148a608429564b240baf6c4aa0645e07c61879779b0f
4
+ data.tar.gz: 8470f58a2d5e1b4688ffecbeef0b6214bf910ba2c8bb8728ffd204b316e98437
5
5
  SHA512:
6
- metadata.gz: cfc18005e3be92d5699e4f0e31abf1bff6db288102c8e5694c2f1bde806df281725f4febde50fa01988bb56362eefdc52cb258386bdc1275431b137e1ebe7e6d
7
- data.tar.gz: cc309a15f2b368d17903742bcbd1ee1a6f31bbf6011dcac72a1f0231c23ab27cec813d9302cb5a8315f0ff1999cddc1f368c5b7f675d26466f44b5ae1898e954
6
+ metadata.gz: bd84db64c8238e86f2d7715eb8c15f7123ca385436434b6ad2ca69c465ad29b164f4f8aa9f31bea2bbf05f432ee2b4e9c6bce8347fb5b36accb8d319babd6684
7
+ data.tar.gz: 181f1e7f3b8a0b5e7fb2ac10921e5132f56218a1663354e89c3cbbb327dd3c5ca155ea6a6c6450797bd48de560df312ccb32aaa49eba14e65c3bad2c8ad9298f
@@ -4,7 +4,7 @@ namespace :puma do
4
4
  task :config do
5
5
  on roles(:web) do
6
6
  template "puma.rb.erb", "/tmp/puma_conf"
7
- sudo "mv /tmp/puma_conf #{shared_path}/config"
7
+ sudo "mv /tmp/puma_conf #{shared_path}/config/puma.rb"
8
8
  end
9
9
  end
10
10
  namespace :sysvinit do
@@ -32,7 +32,7 @@ namespace :puma do
32
32
  task :setup do
33
33
  on roles(:web) do
34
34
  template "puma_supervisor.erb", "/tmp/puma"
35
- sudo "mv /tmp/puma /etc/supervisor/conf.d/#{fetch(:application)}"
35
+ sudo "mv /tmp/puma /etc/supervisor/conf.d/#{fetch(:application)}.conf"
36
36
  sudo "supervisorctl reread"
37
37
  sudo "supervisorctl update" # it will auto start the application
38
38
  template "nginx_puma_config.erb", "/tmp/nginx_puma_config"
@@ -25,7 +25,7 @@ namespace :resque do
25
25
  task :setup do
26
26
  on roles(:resque) do
27
27
  template "resque_supervisor.erb", "/tmp/resque"
28
- sudo "mv /tmp/resque /etc/supervisor/conf.d/resque"
28
+ sudo "mv /tmp/resque /etc/supervisor/conf.d/resque.conf"
29
29
  sudo "supervisorctl reread"
30
30
  sudo "supervisorctl update" # it will auto start the application
31
31
  end
@@ -25,7 +25,7 @@ namespace :resque_scheduler do
25
25
  task :setup do
26
26
  on roles(:resque) do
27
27
  template "resque_scheduler_supervisor.erb", "/tmp/resque_scheduler"
28
- sudo "mv /tmp/resque_scheduler /etc/supervisor/conf.d/resque_scheduler"
28
+ sudo "mv /tmp/resque_scheduler /etc/supervisor/conf.d/resque_scheduler.conf"
29
29
  sudo "supervisorctl reread"
30
30
  sudo "supervisorctl update" # it will auto start the application
31
31
  end
@@ -25,7 +25,7 @@ namespace :sidekiq do
25
25
  task :setup do
26
26
  on roles(:sidekiq) do
27
27
  template "sidekiq_supervisor.erb", "/tmp/sidekiq"
28
- sudo "mv /tmp/sidekiq /etc/supervisor/conf.d/sidekiq"
28
+ sudo "mv /tmp/sidekiq /etc/supervisor/conf.d/sidekiq.conf"
29
29
  sudo "supervisorctl reread"
30
30
  sudo "supervisorctl update" # it will auto start the application
31
31
  end
@@ -39,5 +39,38 @@ namespace :sidekiq do
39
39
  end
40
40
  end
41
41
  end
42
+ task :unload do
43
+ desc "tell sidekiq stop receive new jobs, called at the beginning"
44
+ on roles(:sidekiq) do
45
+ execute "supervisorctl signal TSTP sidekiq"
46
+ end
47
+ end
48
+ task :rolling_restart do
49
+ desc "used for rolling restart, only available on enterprise version"
50
+ on roles(:sidekiq) do
51
+ execute "supervisorctl signal USR2 sidekiq"
52
+ end
53
+ end
54
+
55
+ %w[start_group stop_group restart_group].each do |command|
56
+ desc "#{command} sidekiq"
57
+ task command do
58
+ on roles(:sidekiq) do
59
+ execute "supervisorctl #{command.split('_')[0]} sidekiq:*"
60
+ end
61
+ end
62
+ end
63
+ task :unload_group do
64
+ desc "tell sidekiq stop receive new jobs, called at the beginning"
65
+ on roles(:sidekiq) do
66
+ execute "supervisorctl signal TSTP sidekiq:*"
67
+ end
68
+ end
69
+ task :rolling_restart_group do
70
+ desc "used for rolling restart, only available on enterprise version"
71
+ on roles(:sidekiq) do
72
+ execute "supervisorctl signal USR2 sidekiq:*"
73
+ end
74
+ end
42
75
  end
43
76
  end
@@ -26,7 +26,7 @@ namespace :unicorn do
26
26
  task :setup do
27
27
  on roles(:web) do
28
28
  template "unicorn_supervisor.erb", "/tmp/unicorn"
29
- sudo "mv /tmp/unicorn /etc/supervisor/conf.d/#{fetch(:application)}"
29
+ sudo "mv /tmp/unicorn /etc/supervisor/conf.d/#{fetch(:application)}.conf"
30
30
  sudo "supervisorctl reread"
31
31
  sudo "supervisorctl update" # it will auto start the application
32
32
  template "nginx_config.erb", "/tmp/nginx_config"
@@ -1,8 +1,10 @@
1
1
  <%= fetch(:deploy_to) %>/shared/log/*.log {
2
- daily
2
+ su deploy deploy
3
+ maxsize 1G
4
+ weekly
3
5
  missingok
4
6
  copytruncate
5
- rotate 7
7
+ rotate 5
6
8
  compress
7
9
  notifempty
8
- }
10
+ }
@@ -15,6 +15,9 @@ server {
15
15
  }
16
16
 
17
17
  location @<%= fetch(:application) %> {
18
+ proxy_set_header X-Forwarded-Proto $scheme;
19
+ proxy_set_header X-Forwarded-Ssl on;
20
+ proxy_set_header X-Forwarded-Port 443;
18
21
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
19
22
  proxy_set_header Host $http_host;
20
23
  proxy_redirect off;
@@ -26,4 +29,4 @@ server {
26
29
  error_page 500 502 503 504 /500.html;
27
30
  client_max_body_size 1G;
28
31
  keepalive_timeout 10;
29
- }
32
+ }
@@ -7,8 +7,6 @@ server {
7
7
  server_name <%= fetch(:server_address) %>;
8
8
 
9
9
  root <%= fetch(:deploy_to) %>/current/public;
10
- access_log <%= fetch(:deploy_to) %>/current/log/nginx.access.log;
11
- error_log <%= fetch(:deploy_to) %>/current/log/nginx.error.log info;
12
10
 
13
11
  location ^~ /assets/ {
14
12
  gzip_static on;
@@ -18,6 +16,7 @@ server {
18
16
 
19
17
  try_files $uri $uri @<%= fetch(:application) %>;
20
18
  location @<%= fetch(:application) %> {
19
+ proxy_set_header X-Forwarded-Proto $scheme;
21
20
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
22
21
  proxy_set_header Host $http_host;
23
22
  proxy_redirect off;
@@ -1,18 +1,18 @@
1
1
  #!/usr/bin/env puma
2
2
 
3
3
  directory '<%= current_path %>'
4
- rackup "#{current_path}/config.ru"
4
+ rackup '<%= current_path %>/config.ru'
5
5
  environment '<%= fetch(:rails_env, 'production') %>'
6
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
7
+ pidfile '<%= shared_path %>/pids/puma.pid'
8
+ state_path '<%= shared_path %>/pids/puma.state'
9
+ stdout_redirect '<%= shared_path %>/log/<%= fetch(:application)%>.log', '<%= shared_path %>/log/<%= fetch(:application)%>.log', true
10
10
 
11
11
  threads <%= fetch(:puma_threads, [0, 1]).join(',')%>
12
12
 
13
- bind "unix:///tmp/<%= fetch(:application)%>.sock"
13
+ bind 'unix:///tmp/<%= fetch(:application)%>.sock'
14
14
 
15
- activate_control_app "unix://#{shared_path}/tmp/sockets/pumactl.sock"
15
+ activate_control_app 'unix://<%= shared_path %>/tmp/sockets/pumactl.sock'
16
16
 
17
17
  workers <%= fetch(:puma_workers, 2) %>
18
18
 
@@ -20,7 +20,7 @@ preload_app!
20
20
 
21
21
  on_restart do
22
22
  puts 'Refreshing Gemfile'
23
- ENV["BUNDLE_GEMFILE"] = "<%= fetch(:bundle_gemfile, "#{current_path}/Gemfile") %>"
23
+ ENV['BUNDLE_GEMFILE'] = '<%= current_path %>/Gemfile'
24
24
  end
25
25
 
26
26
  before_fork do
@@ -7,7 +7,7 @@ autostart=<%= fetch(:autostart, 'true') %>
7
7
  autorestart=<%= fetch(:autorestart, 'true') %>
8
8
  startsecs=5
9
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
10
+ stderr_logfile=<%= fetch(:deploy_to) %>/shared/log/<%= fetch(:application) %>.log
11
+ stdout_logfile=<%= fetch(:deploy_to) %>/shared/log/<%= fetch(:rails_env) %>.log
12
12
  stdout_logfile_maxbytes=<%= fetch(:logfile_maxbytes, '5GB') %>
13
13
  stdout_logfile_backups=<%= fetch(:logfile_backups, '10') %>
@@ -5,6 +5,7 @@ directory=<%= fetch(:deploy_to) %>/current
5
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
6
  autostart=<%= fetch(:autostart, 'true') %>
7
7
  autorestart=<%= fetch(:autorestart, 'true') %>
8
+ stopsignal=QUIT
8
9
  startsecs=5
9
10
  startretries=3
10
11
  stdout_logfile=<%= fetch(:deploy_to) %>/shared/log/resque_scheduler.log
@@ -5,6 +5,7 @@ directory=<%= fetch(:deploy_to) %>/current
5
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
6
  autostart=<%= fetch(:autostart, 'true') %>
7
7
  autorestart=<%= fetch(:autorestart, 'true') %>
8
+ stopsignal=QUIT
8
9
  startsecs=5
9
10
  startretries=3
10
11
  stdout_logfile=<%= fetch(:deploy_to) %>/shared/log/resque.log
@@ -1,3 +1,3 @@
1
1
  module PixelforceRecipes
2
- VERSION = "1.8"
2
+ VERSION = "2.0"
3
3
  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.8'
4
+ version: '2.0'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Zhang
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-04 00:00:00.000000000 Z
11
+ date: 2021-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -119,7 +119,7 @@ homepage: https://git.pixelforcesystems.com.au/
119
119
  licenses:
120
120
  - MIT
121
121
  metadata: {}
122
- post_install_message:
122
+ post_install_message:
123
123
  rdoc_options: []
124
124
  require_paths:
125
125
  - lib
@@ -134,9 +134,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
134
  - !ruby/object:Gem::Version
135
135
  version: '0'
136
136
  requirements: []
137
- rubyforge_project:
138
- rubygems_version: 2.7.9
139
- signing_key:
137
+ rubygems_version: 3.0.6
138
+ signing_key:
140
139
  specification_version: 4
141
140
  summary: Write a short summary, because Rubygems requires one.
142
141
  test_files: []