capistrano-ruboty 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9dd52957964579ff8d20506186bffc2fc6f583a2
4
- data.tar.gz: 54df02eda7802520ebc42945dae57597d30a3eea
3
+ metadata.gz: 37694ac7be4eb7e623358029f51b61042fc18bde
4
+ data.tar.gz: f1bb2652df1760eb70d3b719120a606a648bdf71
5
5
  SHA512:
6
- metadata.gz: d238ab5cd67ef4f2d96251df80791fd02c64f8eda9619cbe6323c21fddfc19fe109b2f66a57d7dccaa933098e439cc067336fbadbee7a11fa01d91e8642380ea
7
- data.tar.gz: d59b8b1c2392716c84dfc2d303541374c6c5c2ad33456b89c3cd6bbce2afb13c6cc0284c9d99ba5aee0f225c1a65483be782c06674846c0a1c1d1badd2a5fb3b
6
+ metadata.gz: 381713b830f92840a10a181c1e5bd04f929186c5a61d15206260c15e70160d78081db77084b5ea53188dc2f3a35091e249cf2209f2e83e86c6d30c55d03c8cda
7
+ data.tar.gz: 2e062331a4780f12a0654e77265684d7832ad58def7556dc90fa273fbb95a1378c8de491610d09aed983bdd30e7a0a1c4239ec2147f833faed9ca1b4faf52bb6
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Ruboty
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
@@ -23,29 +23,35 @@ namespace :load do
23
23
  end
24
24
 
25
25
  namespace :deploy do
26
- before :starting, :check_ruboty_hooks do
27
- invoke "ruboty:add_default_hooks" if fetch(:ruboty_default_hooks)
26
+ after :publishing, :restart_ruboty do
27
+ invoke "ruboty:restart" if fetch(:ruboty_default_hooks)
28
28
  end
29
29
  end
30
30
 
31
31
  namespace :ruboty do
32
+ desc "Start ruboty"
32
33
  task :start do
33
- command_args = []
34
- command_args += Array(fetch(:ruboty_command))
35
- command_args += %w(--dotenv) if fetch(:ruboty_dotenv)
36
- command_args += %w(--daemon) if fetch(:ruboty_daemon)
37
- command_args += ["--pid", fetch(:ruboty_pid)] if fetch(:ruboty_pid)
38
- command_args += Array(fetch(:ruboty_options)) if fetch(:ruboty_options)
39
-
40
34
  on fetch(:ruboty_servers) do
41
35
  within release_path do
42
36
  with ruboty_env: fetch(:ruboty_env) do
43
- execute(*command_args)
37
+ pid = existing_pid(fetch(:ruboty_pid))
38
+ if pid
39
+ info "ruboty is already running."
40
+ else
41
+ command_args = []
42
+ command_args += Array(fetch(:ruboty_command))
43
+ command_args += %w(--dotenv) if fetch(:ruboty_dotenv)
44
+ command_args += %w(--daemon) if fetch(:ruboty_daemon)
45
+ command_args += ["--pid", fetch(:ruboty_pid)] if fetch(:ruboty_pid)
46
+ command_args += Array(fetch(:ruboty_options)) if fetch(:ruboty_options)
47
+ execute(*command_args)
48
+ end
44
49
  end
45
50
  end
46
51
  end
47
52
  end
48
53
 
54
+ desc "Stop ruboty"
49
55
  task :stop do
50
56
  on fetch(:ruboty_servers) do
51
57
  within release_path do
@@ -77,12 +83,9 @@ namespace :ruboty do
77
83
  pid
78
84
  end
79
85
 
86
+ desc "Restart ruboty"
80
87
  task :restart do
81
88
  invoke "ruboty:stop"
82
89
  invoke "ruboty:start"
83
90
  end
84
-
85
- task :add_default_hooks do
86
- after "deploy:publishing", "ruboty:restart"
87
- end
88
91
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-ruboty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masato Ikeda