mina-puma 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +27 -22
- data/lib/mina/puma/tasks.rake +19 -12
- data/lib/mina/puma/version.rb +1 -1
- data/mina-puma.gemspec +1 -0
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbed1e584caa959bbc8ce546e651e978dd073c39
|
4
|
+
data.tar.gz: 416d5036fef3276f518566f6bb3621160eacb029
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d67de609987ad03db27f5d58560dfc344cf55cf708ad4d9b56f0d1fd158d89bd925a08a84970e2900a86b62325424aba234de4657a6a4345323a5d261d98491
|
7
|
+
data.tar.gz: 431f8c240baf07e03e4084a953d3dfb671ebfc72bd3fd4448f1eef8631c2f0f318a0048cd4e30dfabcadd8300e0fc899c6bf33a7e8130f40bd6603fd75be3b8f
|
data/README.md
CHANGED
@@ -5,8 +5,9 @@
|
|
5
5
|
|
6
6
|
This gem provides several mina tasks:
|
7
7
|
|
8
|
-
mina puma:phased_restart # Restart puma (
|
9
|
-
mina puma:
|
8
|
+
mina puma:phased_restart # Restart puma (using phased restart)
|
9
|
+
mina puma:hard_restart # Restart puma (using stop, then start)
|
10
|
+
mina puma:restart # Restart puma (using pumactl)
|
10
11
|
mina puma:start # Start puma
|
11
12
|
mina puma:stop # Stop puma
|
12
13
|
|
@@ -55,32 +56,36 @@ $ mina puma:start
|
|
55
56
|
```
|
56
57
|
|
57
58
|
## Example
|
59
|
+
```ruby
|
60
|
+
require 'mina/puma'
|
58
61
|
|
59
|
-
|
62
|
+
task :setup => :environment do
|
63
|
+
# Puma needs a place to store its pid file and socket file.
|
64
|
+
queue! %(mkdir -p "#{deploy_to}/#{shared_path}/tmp/sockets")
|
65
|
+
queue! %(chmod g+rx,u+rwx "#{deploy_to}/#{shared_path}/tmp/sockets")
|
66
|
+
queue! %(mkdir -p "#{deploy_to}/#{shared_path}/tmp/pids")
|
67
|
+
queue! %(chmod g+rx,u+rwx "#{deploy_to}/#{shared_path}/tmp/pids")
|
60
68
|
|
61
|
-
|
62
|
-
# Puma needs a place to store its pid file and socket file.
|
63
|
-
queue! %(mkdir -p "#{deploy_to}/#{shared_path}/tmp/sockets")
|
64
|
-
queue! %(chmod g+rx,u+rwx "#{deploy_to}/#{shared_path}/tmp/sockets")
|
65
|
-
queue! %(mkdir -p "#{deploy_to}/#{shared_path}/tmp/pids")
|
66
|
-
queue! %(chmod g+rx,u+rwx "#{deploy_to}/#{shared_path}/tmp/pids")
|
69
|
+
...
|
67
70
|
|
68
|
-
|
71
|
+
end
|
69
72
|
|
70
|
-
|
73
|
+
# Add pids and sockets directories to shared paths
|
74
|
+
set :shared_paths, ['config/database.yml', 'tmp/pids', 'tmp/sockets']
|
71
75
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
end
|
82
|
-
end
|
76
|
+
task :deploy do
|
77
|
+
deploy do
|
78
|
+
invoke :'git:clone'
|
79
|
+
invoke :'deploy:link_shared_paths'
|
80
|
+
...
|
81
|
+
|
82
|
+
to :launch do
|
83
|
+
...
|
84
|
+
invoke :'puma:phased_restart'
|
83
85
|
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
```
|
84
89
|
|
85
90
|
## Contributing
|
86
91
|
|
data/lib/mina/puma/tasks.rake
CHANGED
@@ -23,7 +23,7 @@ namespace :puma do
|
|
23
23
|
if [ -e '#{puma_config}' ]; then
|
24
24
|
cd #{deploy_to}/#{current_path} && #{puma_cmd} -q -d -e #{puma_env} -C #{puma_config}
|
25
25
|
else
|
26
|
-
cd #{deploy_to}/#{current_path} && #{puma_cmd} -q -d -e #{puma_env} -b 'unix://#{puma_socket}' -S #{puma_state} --control 'unix://#{pumactl_socket}'
|
26
|
+
cd #{deploy_to}/#{current_path} && #{puma_cmd} -q -d -e #{puma_env} -b 'unix://#{puma_socket}' -S #{puma_state} --pidfile #{puma_pid} --control 'unix://#{pumactl_socket}'
|
27
27
|
fi
|
28
28
|
fi
|
29
29
|
]
|
@@ -31,27 +31,34 @@ namespace :puma do
|
|
31
31
|
|
32
32
|
desc 'Stop puma'
|
33
33
|
task stop: :environment do
|
34
|
-
|
35
|
-
|
36
|
-
cd #{deploy_to}/#{current_path} && #{pumactl_cmd} -S #{puma_state} stop
|
37
|
-
rm -f '#{pumactl_socket}'
|
38
|
-
else
|
39
|
-
echo 'Puma is not running!';
|
40
|
-
fi
|
41
|
-
]
|
34
|
+
pumactl_command 'stop'
|
35
|
+
queue! %[rm -f '#{pumactl_socket}']
|
42
36
|
end
|
43
37
|
|
44
38
|
desc 'Restart puma'
|
45
39
|
task restart: :environment do
|
46
|
-
|
47
|
-
invoke :'puma:start'
|
40
|
+
pumactl_command 'restart'
|
48
41
|
end
|
49
42
|
|
50
43
|
desc 'Restart puma (phased restart)'
|
51
44
|
task phased_restart: :environment do
|
45
|
+
pumactl_command 'phased-restart'
|
46
|
+
end
|
47
|
+
|
48
|
+
desc 'Restart puma (hard restart)'
|
49
|
+
task hard_restart: :environment do
|
50
|
+
invoke 'puma:stop'
|
51
|
+
invoke 'puma:start'
|
52
|
+
end
|
53
|
+
|
54
|
+
def pumactl_command(command)
|
52
55
|
queue! %[
|
53
56
|
if [ -e '#{pumactl_socket}' ]; then
|
54
|
-
|
57
|
+
if [ -e '#{puma_config}' ]; then
|
58
|
+
cd #{deploy_to}/#{current_path} && #{pumactl_cmd} -F #{puma_config} #{command}
|
59
|
+
else
|
60
|
+
cd #{deploy_to}/#{current_path} && #{pumactl_cmd} -S #{puma_state} -C 'unix://#{pumactl_socket}' --pidfile #{puma_pid} #{command}
|
61
|
+
fi
|
55
62
|
else
|
56
63
|
echo 'Puma is not running!';
|
57
64
|
fi
|
data/lib/mina/puma/version.rb
CHANGED
data/mina-puma.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mina-puma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Sandelius
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mina
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: puma
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2.13'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '2.13'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: bundler
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -88,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
102
|
version: '0'
|
89
103
|
requirements: []
|
90
104
|
rubyforge_project:
|
91
|
-
rubygems_version: 2.
|
105
|
+
rubygems_version: 2.4.5.1
|
92
106
|
signing_key:
|
93
107
|
specification_version: 4
|
94
108
|
summary: Puma tasks for Mina
|