capistrano-pumactl 0.0.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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f75e3a80269478ff8c6ec0db7c3c17d173e18b3c
4
+ data.tar.gz: 05b4424947cd149d05487e8c0fe5bea562f7a3ae
5
+ SHA512:
6
+ metadata.gz: 319845844be0c78dcb3626d890e9ecdfd986b6fb50e737aac38bcd056e9a5679b813df49bcb1e151d20c8e833c53584ba2197b61d4d2d81c8c7f7f4f1b08cd9d
7
+ data.tar.gz: a12799d84aec7a196dada311cdc49fa10f458bfc3ab732ab760affa98c6334ac3d991809093ffcedf44d2f5c04b788e2b7cdd0c5900270e17cd776e61220c41b
@@ -0,0 +1,22 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /test/tmp/
9
+ /test/version_tmp/
10
+ /tmp/
11
+
12
+ ## Documentation cache and generated files:
13
+ /.yardoc/
14
+ /_yardoc/
15
+ /doc/
16
+ /rdoc/
17
+
18
+ ## Environment normalisation:
19
+ /.bundle/
20
+ /lib/bundler/man/
21
+
22
+ Gemfile.lock
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in capistrano-pumactl.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2016 Koen Punt
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,74 @@
1
+ # Capistrano::pumactl
2
+
3
+ Puma server control tasks for Capistrano 3
4
+
5
+ ## Installation
6
+
7
+ ```ruby
8
+ gem 'capistrano', '~> 3.1'
9
+ gem 'capistrano-pumactl'
10
+ ```
11
+
12
+ And then execute:
13
+
14
+ $ bundle
15
+
16
+ Or install it yourself as:
17
+
18
+ $ gem install capistrano-pumactl
19
+
20
+ ## Usage
21
+
22
+ Require in `Capfile`:
23
+
24
+ ```ruby
25
+ require 'capistrano/pumactl'
26
+ ```
27
+
28
+ Configurable options, shown here with defaults:
29
+
30
+ ```ruby
31
+ set :pumactl_roles, :app
32
+ set :pumactl_config_file, -> { current_path.join('config/puma.rb') }
33
+ ```
34
+
35
+ ### Tasks
36
+
37
+ This gem provides the following Capistrano tasks:
38
+
39
+ * `pumactl:halt`
40
+ * `pumactl:restart`
41
+ * `pumactl:phased-restart`
42
+ * `pumactl:start`
43
+ * `pumactl:stats`
44
+ * `pumactl:reload-worker-directory`
45
+ * `pumactl:status`
46
+ * `pumactl:stop`
47
+
48
+ ## Example
49
+
50
+ Instruct Capistrano to run a phased restart after deploy:
51
+
52
+ ```ruby
53
+ # Hook phased-restart after publishing
54
+ after :'deploy:publishing', :'pumactl:phased-restart'
55
+ ```
56
+
57
+ ## Notes
58
+
59
+ When using `rbenv`, `rvm`, `chruby` and/or `bundler` don't forget to add `pumactl` to the bins list:
60
+
61
+ ```ruby
62
+ fetch(:rbenv_map_bins, []).push 'pumactl'
63
+ fetch(:rvm_map_bins, []).push 'pumactl'
64
+ fetch(:chruby_map_bins, []).push 'pumactl'
65
+ fetch(:bundle_bins, []).push 'pumactl'
66
+ ```
67
+
68
+ ## Contributing
69
+
70
+ 1. Fork it
71
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
72
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
73
+ 4. Push to the branch (`git push origin my-new-feature`)
74
+ 5. Create new Pull Request
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'capistrano-pumactl'
7
+ spec.version = '0.0.1'
8
+ spec.authors = ['Koen Punt']
9
+ spec.email = ['me@koen.pt']
10
+ spec.description = %q{Puma server control tasks for Capistrano 3.x}
11
+ spec.summary = %q{Puma server control tasks for Capistrano 3.x}
12
+ spec.homepage = 'https://github.com/koenpunt/capistrano-pumactl'
13
+ spec.license = 'MIT'
14
+
15
+ spec.files = `git ls-files`.split($/)
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ['lib']
19
+
20
+ spec.add_dependency 'capistrano', '~> 3.1'
21
+
22
+ spec.add_development_dependency 'bundler', '~> 1.3'
23
+ spec.add_development_dependency 'rake'
24
+ end
File without changes
@@ -0,0 +1 @@
1
+ load File.expand_path('../tasks/pumactl.rake', __FILE__)
@@ -0,0 +1,40 @@
1
+ namespace :pumactl do
2
+
3
+ ACTIONS = %w(
4
+ halt restart phased-restart start stats
5
+ reload-worker-directory status stop
6
+ )
7
+
8
+ task :validate do
9
+ on release_roles(fetch(:pumactl_roles)) do
10
+ puma_config_file = fetch(:pumactl_config_file)
11
+ unless test "[ -f #{puma_config_file} ]"
12
+ warn "puma: #{puma_config_file} is not found"
13
+ end
14
+ end
15
+ end
16
+
17
+ ACTIONS.each do |action|
18
+ desc "Execute pumactl #{action}"
19
+ task :"#{action}" do
20
+ on release_roles(fetch(:pumactl_roles)) do
21
+ within release_path do
22
+ execute :pumactl, '--config-file', fetch(:pumactl_config_file), action
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+
29
+ Capistrano::DSL.stages.each do |stage|
30
+ after stage, :'pumactl:validate'
31
+ end
32
+
33
+ namespace :load do
34
+ task :defaults do
35
+ set :pumactl_config_file, -> { current_path.join('config/puma.rb') }
36
+ # set :pumactl_pidfile, -> { current_path.join('tmp/pids/puma.pid') }
37
+ # set :pumactl_state_path, -> { current_path.join('tmp/pids/puma.state') }
38
+ set :pumactl_roles, fetch(:pumactl_roles, :app)
39
+ end
40
+ end
metadata ADDED
@@ -0,0 +1,95 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-pumactl
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Koen Punt
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-11-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: capistrano
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.3'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Puma server control tasks for Capistrano 3.x
56
+ email:
57
+ - me@koen.pt
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - Gemfile
64
+ - LICENSE
65
+ - README.md
66
+ - Rakefile
67
+ - capistrano-pumactl.gemspec
68
+ - lib/capistrano-pumactl.rb
69
+ - lib/capistrano/pumactl.rb
70
+ - lib/capistrano/tasks/pumactl.rake
71
+ homepage: https://github.com/koenpunt/capistrano-pumactl
72
+ licenses:
73
+ - MIT
74
+ metadata: {}
75
+ post_install_message:
76
+ rdoc_options: []
77
+ require_paths:
78
+ - lib
79
+ required_ruby_version: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ required_rubygems_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ requirements: []
90
+ rubyforge_project:
91
+ rubygems_version: 2.4.5
92
+ signing_key:
93
+ specification_version: 4
94
+ summary: Puma server control tasks for Capistrano 3.x
95
+ test_files: []