capistrano3-puma 5.2.0 → 6.0.0.beta.1

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.
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.2.0
4
+ version: 6.0.0.beta.1
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-09-11 00:00:00.000000000 Z
11
+ date: 2022-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -44,20 +44,20 @@ dependencies:
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '4.0'
47
+ version: '5.1'
48
48
  - - "<"
49
49
  - !ruby/object:Gem::Version
50
- version: '6.0'
50
+ version: '7.0'
51
51
  type: :runtime
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
54
54
  requirements:
55
55
  - - ">="
56
56
  - !ruby/object:Gem::Version
57
- version: '4.0'
57
+ version: '5.1'
58
58
  - - "<"
59
59
  - !ruby/object:Gem::Version
60
- version: '6.0'
60
+ version: '7.0'
61
61
  description: Puma integration for Capistrano 3
62
62
  email:
63
63
  - Terminale@gmail.com
@@ -65,38 +65,17 @@ executables: []
65
65
  extensions: []
66
66
  extra_rdoc_files: []
67
67
  files:
68
- - ".github/workflows/stale.yml"
69
- - ".gitignore"
70
68
  - CHANGELOG.md
71
- - CONTRIBUTORS.md
72
- - Gemfile
73
69
  - LICENSE.txt
74
70
  - README.md
75
- - Rakefile
76
- - capistrano3-puma.gemspec
77
71
  - lib/capistrano/puma.rb
78
- - lib/capistrano/puma/daemon.rb
79
- - lib/capistrano/puma/jungle.rb
80
- - lib/capistrano/puma/monit.rb
81
72
  - lib/capistrano/puma/nginx.rb
82
73
  - lib/capistrano/puma/systemd.rb
83
- - lib/capistrano/puma/version.rb
84
- - lib/capistrano/puma/workers.rb
85
- - lib/capistrano/tasks/daemon.rake
86
- - lib/capistrano/tasks/jungle.rake
87
- - lib/capistrano/tasks/monit.rake
88
74
  - lib/capistrano/tasks/nginx.rake
89
- - lib/capistrano/tasks/puma.rake
90
75
  - lib/capistrano/tasks/systemd.rake
91
- - lib/capistrano/tasks/workers.rake
92
76
  - lib/capistrano/templates/nginx_conf.erb
93
- - lib/capistrano/templates/puma-deb.erb
94
- - lib/capistrano/templates/puma-rpm.erb
95
- - lib/capistrano/templates/puma.rb.erb
96
77
  - lib/capistrano/templates/puma.service.erb
97
78
  - lib/capistrano/templates/puma.socket.erb
98
- - lib/capistrano/templates/puma_monit.conf.erb
99
- - lib/capistrano/templates/run-puma.erb
100
79
  - lib/capistrano3-puma.rb
101
80
  - lib/generators/capistrano/nginx_puma/USAGE
102
81
  - lib/generators/capistrano/nginx_puma/config_generator.rb
@@ -104,8 +83,8 @@ homepage: https://github.com/seuros/capistrano-puma
104
83
  licenses:
105
84
  - MIT
106
85
  metadata: {}
107
- post_install_message: "\n All plugins need to be explicitly installed with install_plugin.\n
108
- \ Please see README.md\n "
86
+ post_install_message: "\n Version 6.0.0 is a major release. Please see README.md,
87
+ breaking changes are listed in CHANGELOG.md\n "
109
88
  rdoc_options: []
110
89
  require_paths:
111
90
  - lib
@@ -113,14 +92,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
113
92
  requirements:
114
93
  - - ">="
115
94
  - !ruby/object:Gem::Version
116
- version: 1.9.3
95
+ version: '2.5'
117
96
  required_rubygems_version: !ruby/object:Gem::Requirement
118
97
  requirements:
119
- - - ">="
98
+ - - ">"
120
99
  - !ruby/object:Gem::Version
121
- version: '0'
100
+ version: 1.3.1
122
101
  requirements: []
123
- rubygems_version: 3.0.3
102
+ rubygems_version: 3.2.33
124
103
  signing_key:
125
104
  specification_version: 4
126
105
  summary: Puma integration for Capistrano
@@ -1,19 +0,0 @@
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/.gitignore DELETED
@@ -1,18 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .idea
6
- .yardoc
7
- Gemfile.lock
8
- InstalledFiles
9
- _yardoc
10
- coverage
11
- doc/
12
- lib/bundler/man
13
- pkg
14
- rdoc
15
- spec/reports
16
- test/tmp
17
- test/version_tmp
18
- tmp
data/CONTRIBUTORS.md DELETED
@@ -1,48 +0,0 @@
1
- ## Contributors
2
-
3
- - Abdelkader Boudih
4
- - André Arko
5
- - Ariel Zerahia
6
- - Barack Obama
7
- - Bart de Water
8
- - Benjamin Kim
9
- - Bin Huang
10
- - Bryan Liles
11
- - Claudio Poli
12
- - Cyril Rohr
13
- - Fritz Lee
14
- - Feña Agar
15
- - Hnat Kubov
16
- - Ivan Schneider
17
- - James-Hendrickson
18
- - Jens Hausherr
19
- - Jeremy Rottman
20
- - Jesse Cooke
21
- - Johan Lind
22
- - Jordan Hollinger
23
- - Jun Lin
24
- - Kamil Giszczak
25
- - Kevin Collignon
26
- - Konstantin Papkovskiy
27
- - Kyle Decot
28
- - Lisa Hagemann
29
- - Lonre Wang
30
- - Lucas Alves
31
- - Marcos Chicote
32
- - Mario Celit log
33
- - Matias De Santi
34
- - Michael C. Beck
35
- - Neil Bartley
36
- - Philippe Nénert
37
- - Ponomarev Nikolay
38
- - Rafael Goulart
39
- - SHIMADA Koji
40
- - Sergey Ponomarev
41
- - Shane O'Grady
42
- - Simon Males
43
- - Steve Madere
44
- - Suhail Patel
45
- - Suraj Shirvankar
46
- - marshall-lee
47
- - ruohan chen
48
- - ayaya zhao
data/Gemfile DELETED
@@ -1,8 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in capistrano-puma.gemspec
4
- gemspec
5
-
6
- gem "bump", "~> 0.10.0"
7
-
8
- gem "github_changelog_generator", "~> 1.16"
data/Rakefile DELETED
@@ -1,9 +0,0 @@
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
@@ -1,28 +0,0 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'capistrano/puma/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = 'capistrano3-puma'
8
- spec.version = Capistrano::PUMAVERSION
9
- spec.authors = ['Abdelkader Boudih']
10
- spec.email = ['Terminale@gmail.com']
11
- spec.description = %q{Puma integration for Capistrano 3}
12
- spec.summary = %q{Puma integration for Capistrano}
13
- spec.homepage = 'https://github.com/seuros/capistrano-puma'
14
- spec.license = 'MIT'
15
-
16
- spec.required_ruby_version = '>= 1.9.3'
17
-
18
- spec.files = `git ls-files`.split($/)
19
- spec.require_paths = ['lib']
20
-
21
- spec.add_dependency 'capistrano', '~> 3.7'
22
- spec.add_dependency 'capistrano-bundler'
23
- spec.add_dependency 'puma' , '>= 4.0', '< 6.0'
24
- spec.post_install_message = %q{
25
- All plugins need to be explicitly installed with install_plugin.
26
- Please see README.md
27
- }
28
- end
@@ -1,13 +0,0 @@
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
@@ -1,22 +0,0 @@
1
- module Capistrano
2
- class Puma::Jungle < Capistrano::Plugin
3
- include PumaCommon
4
-
5
- def set_defaults
6
- set_if_empty :puma_jungle_conf, '/etc/puma.conf'
7
- set_if_empty :puma_run_path, '/usr/local/bin/run-puma'
8
- end
9
-
10
- def define_tasks
11
- eval_rakefile File.expand_path('../../tasks/jungle.rake', __FILE__)
12
- end
13
-
14
- def debian_install(role)
15
- template_puma 'puma-deb', "#{fetch(:tmp_dir)}/puma", role
16
- end
17
-
18
- def rhel_install(role)
19
- template_puma 'puma-rpm', "#{fetch(:tmp_dir)}/puma", role
20
- end
21
- end
22
- end
@@ -1,34 +0,0 @@
1
- module Capistrano
2
- class Puma::Monit < Capistrano::Plugin
3
- include PumaCommon
4
- def register_hooks
5
- before 'deploy:updating', 'puma:monit:unmonitor'
6
- after 'deploy:published', 'puma:monit:monitor'
7
- end
8
-
9
- def define_tasks
10
- eval_rakefile File.expand_path('../../tasks/monit.rake', __FILE__)
11
- end
12
-
13
- def set_defaults
14
- set_if_empty :puma_monit_conf_dir, -> { "/etc/monit/conf.d/#{puma_monit_service_name}.conf" }
15
- set_if_empty :puma_monit_use_sudo, true
16
- set_if_empty :puma_monit_bin, '/usr/bin/monit'
17
- end
18
-
19
- def puma_monit_service_name
20
- fetch(:puma_monit_service_name, "puma_#{fetch(:application)}_#{fetch(:stage)}")
21
- end
22
-
23
- def sudo_if_needed(command)
24
- if fetch(:puma_monit_use_sudo)
25
- backend.sudo command
26
- else
27
- puma_role = fetch(:puma_role)
28
- backend.on(puma_role) do
29
- backend.execute command
30
- end
31
- end
32
- end
33
- end
34
- end
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Capistrano
4
- PUMAVERSION = '5.2.0'
5
- end
@@ -1,9 +0,0 @@
1
- module Capistrano
2
- class Puma::Workers < Capistrano::Plugin
3
- include PumaCommon
4
-
5
- def define_tasks
6
- eval_rakefile File.expand_path('../../tasks/workers.rake', __FILE__)
7
- end
8
- end
9
- end
@@ -1,74 +0,0 @@
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
@@ -1,65 +0,0 @@
1
- git_plugin = self
2
-
3
- namespace :puma do
4
- namespace :jungle do
5
- desc 'Install Puma jungle'
6
- task :install do
7
- on roles(fetch(:puma_role)) do |role|
8
- git_plugin.template_puma 'run-puma', "#{fetch(:tmp_dir)}/run-puma", role
9
- execute "chmod +x #{fetch(:tmp_dir)}/run-puma"
10
- sudo "mv #{fetch(:tmp_dir)}/run-puma #{fetch(:puma_run_path)}"
11
- if test '[ -f /etc/redhat-release ]'
12
- #RHEL flavor OS
13
- git_plugin.rhel_install(role)
14
- execute "chmod +x #{fetch(:tmp_dir)}/puma"
15
- sudo "mv #{fetch(:tmp_dir)}/puma /etc/init.d/puma"
16
- sudo 'chkconfig --add puma'
17
- elsif test '[ -f /etc/lsb-release ]'
18
- #Debian flavor OS
19
- git_plugin.debian_install(role)
20
- execute "chmod +x #{fetch(:tmp_dir)}/puma"
21
- sudo "mv #{fetch(:tmp_dir)}/puma /etc/init.d/puma"
22
- sudo 'update-rc.d -f puma defaults'
23
- else
24
- #Some other OS
25
- error 'This task is not supported for your OS'
26
- end
27
- sudo "touch #{fetch(:puma_jungle_conf)}"
28
- end
29
- end
30
-
31
- desc 'Setup Puma config and install jungle script'
32
- task :setup do
33
- invoke 'puma:config'
34
- invoke 'puma:jungle:install'
35
- invoke 'puma:jungle:add'
36
- end
37
-
38
- desc 'Add current project to the jungle'
39
- task :add do
40
- on roles(fetch(:puma_role)) do|role|
41
- begin
42
- sudo "/etc/init.d/puma add '#{current_path}' #{fetch(:puma_user, role.user)} '#{fetch(:puma_conf)}'"
43
- rescue => error
44
- warn error
45
- end
46
- end
47
- end
48
-
49
- desc 'Remove current project from the jungle'
50
- task :remove do
51
- on roles(fetch(:puma_role)) do
52
- sudo "/etc/init.d/puma remove '#{current_path}'"
53
- end
54
- end
55
-
56
- %w[start stop restart status].each do |command|
57
- desc "#{command} puma"
58
- task command do
59
- on roles(fetch(:puma_role)) do
60
- sudo "service puma #{command} #{current_path}"
61
- end
62
- end
63
- end
64
- end
65
- end
@@ -1,61 +0,0 @@
1
- git_plugin = self
2
-
3
- namespace :puma do
4
- namespace :monit do
5
- desc 'Config Puma monit-service'
6
- task :config do
7
- on roles(fetch(:puma_role)) do |role|
8
- git_plugin.template_puma 'puma_monit.conf', "#{fetch(:tmp_dir)}/monit.conf", role
9
- git_plugin.sudo_if_needed "mv #{fetch(:tmp_dir)}/monit.conf #{fetch(:puma_monit_conf_dir)}"
10
- git_plugin.sudo_if_needed "#{fetch(:puma_monit_bin)} reload"
11
- # Wait for Monit to be reloaded
12
- sleep 1
13
- end
14
- end
15
-
16
- desc 'Monitor Puma monit-service'
17
- task :monitor do
18
- on roles(fetch(:puma_role)) do
19
- begin
20
- git_plugin.sudo_if_needed "#{fetch(:puma_monit_bin)} monitor #{git_plugin.puma_monit_service_name}"
21
- rescue
22
- invoke 'puma:monit:config'
23
- git_plugin.sudo_if_needed "#{fetch(:puma_monit_bin)} monitor #{git_plugin.puma_monit_service_name}"
24
- end
25
- end
26
- end
27
-
28
- desc 'Unmonitor Puma monit-service'
29
- task :unmonitor do
30
- on roles(fetch(:puma_role)) do
31
- begin
32
- git_plugin.sudo_if_needed "#{fetch(:puma_monit_bin)} unmonitor #{git_plugin.puma_monit_service_name}"
33
- rescue
34
- # no worries here (still no monitoring)
35
- end
36
- end
37
- end
38
-
39
- desc 'Start Puma monit-service'
40
- task :start do
41
- on roles(fetch(:puma_role)) do
42
- git_plugin.sudo_if_needed "#{fetch(:puma_monit_bin)} start #{git_plugin.puma_monit_service_name}"
43
- end
44
- end
45
-
46
- desc 'Stop Puma monit-service'
47
- task :stop do
48
- on roles(fetch(:puma_role)) do
49
- git_plugin.sudo_if_needed "#{fetch(:puma_monit_bin)} stop #{git_plugin.puma_monit_service_name}"
50
- end
51
- end
52
-
53
- desc 'Restart Puma monit-service'
54
- task :restart do
55
- on roles(fetch(:puma_role)) do
56
- git_plugin.sudo_if_needed "#{fetch(:puma_monit_bin)} restart #{git_plugin.puma_monit_service_name}"
57
- end
58
- end
59
-
60
- end
61
- end
@@ -1,21 +0,0 @@
1
- git_plugin = self
2
-
3
- namespace :puma do
4
- desc 'Setup Puma config file'
5
- task :config do
6
- on roles(fetch(:puma_role)) do |role|
7
- git_plugin.upload_puma_rb(role)
8
- end
9
- end
10
-
11
- task :check do
12
- on roles(fetch(:puma_role)) do |role|
13
- #Create puma.rb for new deployments
14
- unless test "[ -f #{fetch(:puma_conf)} ]"
15
- warn 'puma.rb NOT FOUND!'
16
- git_plugin.upload_puma_rb(role)
17
- info 'puma.rb generated'
18
- end
19
- end
20
- end
21
- end
@@ -1,43 +0,0 @@
1
- git_plugin = self
2
-
3
- namespace :puma do
4
- namespace :workers do
5
- desc 'Add a worker'
6
- task :count do
7
- on roles(fetch(:puma_role)) do |role|
8
- git_plugin.puma_switch_user(role) do
9
- #TODO
10
- # cleanup
11
- # add host name/ip
12
- puma_pid = capture("cat #{fetch(:puma_pid)}")
13
- workers_count = capture("ps ax | grep -c 'puma: cluster worker [0-9]: #{puma_pid}'").to_i
14
- log "Workers count : #{workers_count}"
15
- end
16
- end
17
- end
18
-
19
- # TODO
20
- # Add/remove workers to specific host/s
21
- # Define # of workers to add/remove
22
- # Refactor
23
- desc 'Worker++'
24
- task :more do
25
- on roles(fetch(:puma_role)) do |role|
26
- git_plugin.puma_switch_user(role) do
27
- puma_pid = capture("cat #{fetch(:puma_pid)}")
28
- execute(:kill, "-TTIN #{puma_pid}")
29
- end
30
- end
31
- end
32
-
33
- desc 'Worker--'
34
- task :less do
35
- on roles(fetch(:puma_role)) do |role|
36
- git_plugin.puma_switch_user(role) do
37
- puma_pid = capture("cat #{fetch(:puma_pid)}")
38
- execute(:kill, "-TTOU #{puma_pid}")
39
- end
40
- end
41
- end
42
- end
43
- end