capistrano-puma 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/.rvmrc +1 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +53 -0
- data/Rakefile +1 -0
- data/capistrano-puma.gemspec +19 -0
- data/lib/capistrano-puma.rb +7 -0
- data/lib/capistrano-puma/tasks.rb +56 -0
- data/lib/capistrano-puma/version.rb +5 -0
- metadata +55 -0
data/.gitignore
ADDED
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm use 1.9.3@capistrano-puma --create
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Johannes Opper
|
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,53 @@
|
|
1
|
+
# Capistrano::Puma
|
2
|
+
|
3
|
+
Capistrano integration tasks for the [puma web server](https://github.com/puma/puma).
|
4
|
+
|
5
|
+
These tasks assume that you are using the [jungle tool scripts](https://github.com/puma/puma/tree/master/tools/jungle).
|
6
|
+
|
7
|
+
This is an extension of the puma tasks from [Deploying a Rails app on Nginx/Puma with Capistrano](http://tommy.chheng.com/2013/01/23/deploying-a-rails-app-on-nginxpuma-with-capistrano) of [Tommy Chheng](https://github.com/tc).
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
Add this line to your application's Gemfile:
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
gem 'capistrano-puma', require: false
|
15
|
+
```
|
16
|
+
|
17
|
+
And then execute:
|
18
|
+
|
19
|
+
$ bundle
|
20
|
+
|
21
|
+
Or install it yourself as:
|
22
|
+
|
23
|
+
$ gem install capistrano-puma
|
24
|
+
|
25
|
+
## Usage
|
26
|
+
|
27
|
+
Use it in your deploy.rb as:
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
require 'capistrano-puma'
|
31
|
+
```
|
32
|
+
|
33
|
+
It'll automatically perform the start/stop/restart tasks after the corresponding deploy task was called.
|
34
|
+
|
35
|
+
Or you just call it by hand like:
|
36
|
+
|
37
|
+
cap puma:status
|
38
|
+
|
39
|
+
## Available tasks
|
40
|
+
|
41
|
+
cap puma:start # Start puma instance
|
42
|
+
cap puma:stop # Stop puma instance
|
43
|
+
cap puma:restart # Restart puma instance
|
44
|
+
cap puma:status # Status of puma instance
|
45
|
+
cap puma:overview # Status of all puma instances
|
46
|
+
|
47
|
+
## Contributing
|
48
|
+
|
49
|
+
1. Fork it
|
50
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
51
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
52
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
53
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- encoding: 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 |gem|
|
7
|
+
gem.name = "capistrano-puma"
|
8
|
+
gem.version = Capistrano::Puma::VERSION
|
9
|
+
gem.authors = ["Johannes Opper"]
|
10
|
+
gem.email = ["xijo@gmx.de"]
|
11
|
+
gem.description = %q{Provide deployment tasks for puma}
|
12
|
+
gem.summary = %q{Provide deployment tasks for puma}
|
13
|
+
gem.homepage = "http://github.com/xijo/capistrano-puma"
|
14
|
+
|
15
|
+
gem.files = `git ls-files`.split($/)
|
16
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
|
+
gem.require_paths = ["lib"]
|
19
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require 'capistrano'
|
2
|
+
require 'capistrano/version'
|
3
|
+
|
4
|
+
module CapistranoPuma
|
5
|
+
class Tasks
|
6
|
+
def self.load_into(capistrano_config)
|
7
|
+
capistrano_config.load do
|
8
|
+
before(%w[puma:start puma:stop puma:restart puma:status]) do
|
9
|
+
_cset(:puma_app_name) { fetch(:application) }
|
10
|
+
end
|
11
|
+
|
12
|
+
namespace :puma do
|
13
|
+
desc "Start puma instance for this application"
|
14
|
+
task :start do
|
15
|
+
run "/etc/init.d/puma start #{puma_app_name}"
|
16
|
+
end
|
17
|
+
|
18
|
+
desc "Stop puma instance for this application"
|
19
|
+
task :stop do
|
20
|
+
run "/etc/init.d/puma stop #{puma_app_name}"
|
21
|
+
end
|
22
|
+
|
23
|
+
desc "Restart puma instance for this application"
|
24
|
+
task :restart, roles: :app do
|
25
|
+
run "/etc/init.d/puma restart #{puma_app_name}"
|
26
|
+
end
|
27
|
+
|
28
|
+
desc "Show status of puma for this application"
|
29
|
+
task :status, roles: :app do
|
30
|
+
run "/etc/init.d/puma status #{puma_app_name}"
|
31
|
+
end
|
32
|
+
|
33
|
+
desc "Show status of puma for all applications"
|
34
|
+
task :overview, roles: :app do
|
35
|
+
run "/etc/init.d/puma status"
|
36
|
+
end
|
37
|
+
|
38
|
+
desc "Create a shared tmp dir for puma state files"
|
39
|
+
task :after_symlink, roles: :app do
|
40
|
+
run "rm -rf #{release_path}/tmp"
|
41
|
+
run "ln -s #{shared_path}/tmp #{release_path}/tmp"
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
after "deploy:start", "puma:start"
|
46
|
+
after "deploy:stop", "puma:stop"
|
47
|
+
after "deploy:restart", "puma:restart"
|
48
|
+
after "deploy:create_symlink", "puma:after_symlink"
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
if Capistrano::Configuration.instance
|
55
|
+
CapistranoPuma::Tasks.load_into(Capistrano::Configuration.instance)
|
56
|
+
end
|
metadata
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: capistrano-puma
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Johannes Opper
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-01-26 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: Provide deployment tasks for puma
|
15
|
+
email:
|
16
|
+
- xijo@gmx.de
|
17
|
+
executables: []
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- .gitignore
|
22
|
+
- .rvmrc
|
23
|
+
- Gemfile
|
24
|
+
- LICENSE.txt
|
25
|
+
- README.md
|
26
|
+
- Rakefile
|
27
|
+
- capistrano-puma.gemspec
|
28
|
+
- lib/capistrano-puma.rb
|
29
|
+
- lib/capistrano-puma/tasks.rb
|
30
|
+
- lib/capistrano-puma/version.rb
|
31
|
+
homepage: http://github.com/xijo/capistrano-puma
|
32
|
+
licenses: []
|
33
|
+
post_install_message:
|
34
|
+
rdoc_options: []
|
35
|
+
require_paths:
|
36
|
+
- lib
|
37
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
38
|
+
none: false
|
39
|
+
requirements:
|
40
|
+
- - ! '>='
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0'
|
43
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
44
|
+
none: false
|
45
|
+
requirements:
|
46
|
+
- - ! '>='
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
requirements: []
|
50
|
+
rubyforge_project:
|
51
|
+
rubygems_version: 1.8.24
|
52
|
+
signing_key:
|
53
|
+
specification_version: 3
|
54
|
+
summary: Provide deployment tasks for puma
|
55
|
+
test_files: []
|