procodile-capistrano 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1e3dcad918d07063d0a7834ce31ece77e5eff6aa
4
+ data.tar.gz: b43747443ef1323b579d3cc3f42266bd5ebf160c
5
+ SHA512:
6
+ metadata.gz: ed305e8637dccf5c75774fc395fa9ee588c6b5a34314c75b7a82f690825939990bc309d12558b3f84f40c38e294ef7ad1febb9863bb8b9a9315d950e55a58aff
7
+ data.tar.gz: 27cfaf47827f99513f2626fd1211425b1233a3c8fc18f2f49c17a3704f5f69346a59293f7d723064d88f8b13643bc027c4bdc1f6b5f5cee77b4f97e4ff56d57c
@@ -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 ADDED
@@ -0,0 +1,46 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: procodile-capistrano
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Adam Cooke
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-10-18 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Capistrano scripts for deploying applications with Procodile.
14
+ email:
15
+ - me@adamcooke.io
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - lib/procodile/capistrano2.rb
21
+ - lib/procodile/capistrano3.rb
22
+ homepage: https://github.com/adamcooke/procodile-capistrano
23
+ licenses:
24
+ - MIT
25
+ metadata: {}
26
+ post_install_message:
27
+ rdoc_options: []
28
+ require_paths:
29
+ - lib
30
+ required_ruby_version: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ required_rubygems_version: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ requirements: []
41
+ rubyforge_project:
42
+ rubygems_version: 2.5.1
43
+ signing_key:
44
+ specification_version: 4
45
+ summary: Capistrano scripts for deploying applications with Procodile.
46
+ test_files: []