procodile 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/procodile/capistrano2.rb +39 -0
- data/lib/procodile/capistrano3.rb +40 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29cc9799aaaaa76c72574fc9189d026ed3a16aa1
|
4
|
+
data.tar.gz: 506ce012eb6c52c749701d43a6909d6ef41f670e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3678666e81aaec26e1991378cd20dc8bf8d285a52ed054948d91abe99db5f82299764ac5fc724a80f0ad14129ca8a45e06c6e1860fe9d0506d36c471f6ee1ed9
|
7
|
+
data.tar.gz: 09323ed2d5bbd94d7213ceb6d544450e78e9d1898597e44728bf5d0c74e9fc2795f013dc2c62f5e82af577104354850931f61c48d41c2dde9825416a838042e9
|
@@ -0,0 +1,39 @@
|
|
1
|
+
Capistrano::Configuration.instance(:must_exist).load do
|
2
|
+
|
3
|
+
namespace :procodile do
|
4
|
+
|
5
|
+
task :start, :roles => fetch(:procodile_roles, [:app]) do
|
6
|
+
run procodile_command('start')
|
7
|
+
end
|
8
|
+
|
9
|
+
task :stop, :roles => fetch(:procodile_roles, [:app]) do
|
10
|
+
run procodile_command('stop')
|
11
|
+
end
|
12
|
+
|
13
|
+
task :restart, :roles => fetch(:procodile_roles, [:app]) do
|
14
|
+
run procodile_command('restart')
|
15
|
+
end
|
16
|
+
|
17
|
+
task :status, :roles => fetch(:procodile_roles, [:app]) do
|
18
|
+
run procodile_command('status')
|
19
|
+
end
|
20
|
+
|
21
|
+
after 'deploy:start', 'procodile:start'
|
22
|
+
after 'deploy:stop', 'procodile:stop'
|
23
|
+
after 'deploy:restart', 'procodile:restart'
|
24
|
+
|
25
|
+
def procodile_command(command, options = "")
|
26
|
+
binary = fetch(:procodile_binary, 'procodile')
|
27
|
+
if processes = fetch(:processes, nil)
|
28
|
+
options = "-p #{processes} " + options
|
29
|
+
end
|
30
|
+
command = "#{binary} #{command} -r #{current_path} #{options}"
|
31
|
+
if user = fetch(:procodile_user, nil)
|
32
|
+
"sudo -u #{user} #{command}"
|
33
|
+
else
|
34
|
+
command
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
namespace :procodile do
|
2
|
+
desc 'Start procodile processes'
|
3
|
+
task :start do
|
4
|
+
on roles(fetch(:procodile_roles, [:app])) do
|
5
|
+
execute procodile_command(:start)
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
desc 'Stop procodile processes'
|
10
|
+
task :stop do
|
11
|
+
on roles(fetch(:procodile_roles, [:app])) do
|
12
|
+
execute procodile_command(:stop)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
desc 'Restart procodile processes'
|
17
|
+
task :restart do
|
18
|
+
on roles(fetch(:procodile_roles, [:app])) do
|
19
|
+
execute procodile_command(:restart)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
after 'deploy:start', "procodile:start"
|
24
|
+
after 'deploy:stop', "procodile:stop"
|
25
|
+
after 'deploy:restart', "procodile:restart"
|
26
|
+
|
27
|
+
def procodile_command(command, options = "")
|
28
|
+
binary = fetch(:procodile_binary, 'procodile')
|
29
|
+
if processes = fetch(:processes, nil)
|
30
|
+
options = "-p #{processes} " + options
|
31
|
+
end
|
32
|
+
command = "#{binary} #{command} -r #{current_path} #{options}"
|
33
|
+
if user = fetch(:procodile_user, nil)
|
34
|
+
"sudo -u #{user} #{command}"
|
35
|
+
else
|
36
|
+
command
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: procodile
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Cooke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -34,6 +34,8 @@ extra_rdoc_files: []
|
|
34
34
|
files:
|
35
35
|
- bin/procodile
|
36
36
|
- lib/procodile.rb
|
37
|
+
- lib/procodile/capistrano2.rb
|
38
|
+
- lib/procodile/capistrano3.rb
|
37
39
|
- lib/procodile/cli.rb
|
38
40
|
- lib/procodile/config.rb
|
39
41
|
- lib/procodile/control_client.rb
|