vlad-daemon_kit 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,13 @@
1
+ === 1.1.0 / 2009-11-04
2
+
3
+ * 3 enhancements
4
+
5
+ * Added 'arguments' support for start_app, including in task:
6
+ rake vlad:start_app[--help]
7
+ * Added vlad:run_app - runs the application on remote, in foreground
8
+ * Added vlad:console - runs script/console on remote
9
+ * Added vlad:tail - tails the log on remote
10
+
1
11
  === 1.0.1 / 2009-11-04
2
12
 
3
13
  * 2 minor enhancements
data/README.rdoc CHANGED
@@ -28,6 +28,12 @@ Deployment:
28
28
  rake vlad:setup vlad:setup_app # first time
29
29
  rake vlad:update vlad:start_app # subsequent times
30
30
 
31
+ Tools:
32
+
33
+ rake vlad:tail
34
+ rake vlad:tail[-f]
35
+ rake vlad:console
36
+
31
37
  == REQUIREMENTS:
32
38
 
33
39
  * vlad
@@ -1,24 +1,46 @@
1
1
  require 'vlad'
2
2
 
3
3
  class Vlad::DaemonKit
4
- VERSION = '1.0.1'
4
+ VERSION = '1.1.0'
5
5
 
6
6
  set :mkdirs, 'tmp'
7
7
  set :shared_paths, { 'log' => 'log' }
8
8
  set :environment, 'production'
9
+ set :arguments, []
9
10
 
10
11
  namespace :vlad do
12
+ desc "Run the daemon in the foreground"
13
+ remote_task(:run_app, :extra_args, {:roles => :app}) do |task, args|
14
+ extra_args = args[:extra_args]
15
+ run "cd #{current_path} && bin/#{application} -e #{environment} #{arguments.join(' ')} #{extra_args} run"
16
+ end
17
+
11
18
  desc "Start the daemon"
12
- remote_task :start_app, :roles => :app do
13
- commands = %w(stop start).map do |command|
14
- "ruby #{current_path}/bin/#{application} -e #{environment} #{command}"
15
- end
16
- run commands.join(' && ')
19
+ remote_task({:start_app => :stop_app}, :extra_args, {:roles => :app}) do |task, args|
20
+ extra_args = args[:extra_args]
21
+ run "cd #{current_path} && bin/#{application} -e #{environment} #{arguments.join(' ')} #{extra_args} start"
17
22
  end
18
23
 
19
24
  desc "Stop the daemon"
20
25
  remote_task :stop_app, :roles => :app do
21
- run "ruby #{current_path}/bin/#{application} -e #{environment} stop"
26
+ run "cd #{current_path} && bin/#{application} -e #{environment} stop"
27
+ end
28
+
29
+ desc "Run script/console on the remove"
30
+ task :console do
31
+ ssh_flags << ' -t'
32
+ cmd = "'cd #{current_path} && script/console #{environment}'"
33
+ sh [ssh_cmd, ssh_flags, domain, cmd].join(' ')
34
+ end
35
+
36
+ desc "Tail the log"
37
+ task(:tail_app, :extra_args) do |t, args|
38
+ # We don't use a remote task, because it won't terminate cleanly on
39
+ # CTRL+C, which breaks -f args, etc.
40
+ ssh_flags << ' -t'
41
+ extra_args = args[:extra_args]
42
+ cmd = "'cd #{current_path} && tail #{extra_args} log/#{environment}.log'"
43
+ sh [ssh_cmd, ssh_flags, domain, cmd].join(' ')
22
44
  end
23
45
  end
24
46
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vlad-daemon_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Tucker