cap-puma 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.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +38 -0
- data/Rakefile +1 -0
- data/cap-puma.gemspec +23 -0
- data/lib/capistrano/puma.rb +1 -0
- data/lib/capistrano/tasks/puma.rake +83 -0
- metadata +94 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e6cff304d389f27a1734f05e93e166879f709df8
|
4
|
+
data.tar.gz: 244edc01dc21ac73caead0cf0361bf04b4d73324
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 93267d79137bf75b883d69132071053a14e3c1c65638fbf10c94cfda6f93b3613050d0192671224fd1a0c911244a6950e4cddc1fd5ff1c9a86d7b21eb82f7656
|
7
|
+
data.tar.gz: cf4ffbec2d23c9abee1db28ec99485da9426e3967af79852c8b6e38936a3be77e67e9c1105dd62a3f320bd4b40596242c36fbbaa968891c4e3eee61f4836d820
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 John D'Agostino
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
# Capistrano::Puma
|
2
|
+
|
3
|
+
Puma Rake tasks for Capistrano >= 3.0.0
|
4
|
+
|
5
|
+
These tasks have been taken directly from the puma gem
|
6
|
+
|
7
|
+
Includes the following commands;
|
8
|
+
|
9
|
+
- `cap puma:start`
|
10
|
+
- `cap puma:reset`
|
11
|
+
- `cap puma:phased_restart`
|
12
|
+
- `cap puma:stop`
|
13
|
+
|
14
|
+
## Installation
|
15
|
+
|
16
|
+
Add this line to your application's Gemfile:
|
17
|
+
|
18
|
+
gem 'capistrano', '~> 3.0.0'
|
19
|
+
gem 'capistrano-puma'
|
20
|
+
|
21
|
+
And then execute:
|
22
|
+
|
23
|
+
$ bundle --binstubs
|
24
|
+
$ cap install
|
25
|
+
|
26
|
+
## Usage
|
27
|
+
|
28
|
+
Add the following line to your Capfile
|
29
|
+
|
30
|
+
require 'capistrano/puma'
|
31
|
+
|
32
|
+
## Contributing
|
33
|
+
|
34
|
+
1. Fork it
|
35
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
36
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
37
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
38
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/cap-puma.gemspec
ADDED
@@ -0,0 +1,23 @@
|
|
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 = "cap-puma"
|
7
|
+
spec.version = '0.0.1'
|
8
|
+
spec.authors = ["John D'Agostino"]
|
9
|
+
spec.email = ["john.dagostino@gmail.com"]
|
10
|
+
spec.description = %q{Capistrano v3 Rake tasks for Puma}
|
11
|
+
spec.summary = %q{Capistrano v3 Rake tasks for Puma}
|
12
|
+
spec.homepage = "http://github.com/johndagostino/cap-puma"
|
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_development_dependency "bundler", "~> 1.3"
|
21
|
+
spec.add_development_dependency "capistrano", "~> 3.0"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
load File.expand_path("../tasks/puma.rake", __FILE__)
|
@@ -0,0 +1,83 @@
|
|
1
|
+
namespace :puma do
|
2
|
+
before 'deploy:started', :configure do
|
3
|
+
set :puma_cmd, "bundle exec puma"
|
4
|
+
set :pumactl_cmd, "bundle exec pumactl"
|
5
|
+
set :puma_env, fetch(:rack_env, fetch(:rails_env, 'production'))
|
6
|
+
set :puma_state, "#{shared_path}/sockets/puma.state"
|
7
|
+
set :puma_socket, "unix://#{shared_path}/sockets/puma.sock"
|
8
|
+
set :puma_role, :app
|
9
|
+
end
|
10
|
+
|
11
|
+
desc 'Start puma'
|
12
|
+
task :start do
|
13
|
+
on roles fetch(:puma_role) do
|
14
|
+
run "#{puma_cmd} #{start_options}", :pty => false
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
desc 'Stop puma'
|
19
|
+
task :stop do
|
20
|
+
on roles fetch(:puma_role) do
|
21
|
+
within release_path do
|
22
|
+
run "#{pumactl_cmd} -S #{state_path} stop"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
desc 'Restart puma'
|
28
|
+
task :restart do
|
29
|
+
on roles fetch(:puma_role) do
|
30
|
+
within release_path do
|
31
|
+
begin
|
32
|
+
run "#{pumactl_cmd} -S #{state_path} restart"
|
33
|
+
rescue Capistrano::CommandError => ex
|
34
|
+
puts "Failed to restart puma: #{ex}\nAssuming not started."
|
35
|
+
start
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
desc 'Restart puma (phased restart)'
|
42
|
+
task :phased_restart do
|
43
|
+
on roles fetch(:puma_role) do
|
44
|
+
within release_path do
|
45
|
+
run "#{pumactl_cmd} -S #{state_path} phased-restart"
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def start_options
|
51
|
+
if config_file
|
52
|
+
"-q -d -e #{puma_env} -C #{config_file}"
|
53
|
+
else
|
54
|
+
"-q -d -e #{puma_env} -b '#{puma_socket}' -S #{state_path} --control 'unix://#{shared_path}/sockets/pumactl.sock'"
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def config_file
|
59
|
+
@_config_file ||= begin
|
60
|
+
file = fetch(:puma_config_file, nil)
|
61
|
+
file = "./config/puma/#{puma_env}.rb" if !file && File.exists?("./config/puma/#{puma_env}.rb")
|
62
|
+
file
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
def puma_env
|
67
|
+
fetch(:rack_env, fetch(:rails_env, 'production'))
|
68
|
+
end
|
69
|
+
|
70
|
+
def state_path
|
71
|
+
(config_file ? configuration.options[:state] : nil) || puma_state
|
72
|
+
end
|
73
|
+
|
74
|
+
def configuration
|
75
|
+
require 'puma/configuration'
|
76
|
+
|
77
|
+
config = Puma::Configuration.new(:config_file => config_file)
|
78
|
+
config.load
|
79
|
+
config
|
80
|
+
end
|
81
|
+
|
82
|
+
after 'deploy:finishing', :reset
|
83
|
+
end
|
metadata
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cap-puma
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- John D'Agostino
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-10-29 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: capistrano
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.0'
|
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: Capistrano v3 Rake tasks for Puma
|
56
|
+
email:
|
57
|
+
- john.dagostino@gmail.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- .gitignore
|
63
|
+
- Gemfile
|
64
|
+
- LICENSE.txt
|
65
|
+
- README.md
|
66
|
+
- Rakefile
|
67
|
+
- cap-puma.gemspec
|
68
|
+
- lib/capistrano/puma.rb
|
69
|
+
- lib/capistrano/tasks/puma.rake
|
70
|
+
homepage: http://github.com/johndagostino/cap-puma
|
71
|
+
licenses:
|
72
|
+
- MIT
|
73
|
+
metadata: {}
|
74
|
+
post_install_message:
|
75
|
+
rdoc_options: []
|
76
|
+
require_paths:
|
77
|
+
- lib
|
78
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
requirements: []
|
89
|
+
rubyforge_project:
|
90
|
+
rubygems_version: 2.0.3
|
91
|
+
signing_key:
|
92
|
+
specification_version: 4
|
93
|
+
summary: Capistrano v3 Rake tasks for Puma
|
94
|
+
test_files: []
|