mirror of
https://github.com/capistrano/capistrano
synced 2023-03-27 23:21:18 -04:00
Added Actor#tail method that makes it easy to create cross-server tails [DHH]
git-svn-id: http://svn.rubyonrails.org/rails/tools/capistrano@4162 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
a8ec14118c
commit
55e7c7f74d
2 changed files with 28 additions and 0 deletions
|
@ -1,5 +1,12 @@
|
|||
*SVN*
|
||||
|
||||
* Added Actor#tail method that makes it easy to create cross-server tails [DHH]. Example:
|
||||
|
||||
desc "Run a tail on multiple log files at the same time"
|
||||
task :tail_fcgi, :roles => :app do
|
||||
tail "#{shared_path}/log/fastcgi.crash.log"
|
||||
end
|
||||
|
||||
* Make update_code and symlink a macro task under the name "update" for easy of deploy to servers that does not run fcgis [DHH]
|
||||
|
||||
* Changed setup, update_code, rollback_code, and symlink to work on all servers instead of only those in the :app, :web, and :db roles. A server can opt out of being part of the release deployment by setting :no_release => true [DHH]
|
||||
|
|
|
@ -212,6 +212,27 @@ module Capistrano
|
|||
end
|
||||
end
|
||||
|
||||
# Puts a tail on the file from all servers that are the target of the
|
||||
# current task. All the tails will be joined into a single coherent stream,
|
||||
# so you can watch 10 log files as though they were one. Do note that this
|
||||
# is quite expensive from a bandwidth perspective, so use it with care.
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# desc "Run a tail on multiple log files at the same time"
|
||||
# task :tail_fcgi, :roles => :app do
|
||||
# tail "#{shared_path}/log/fastcgi.crash.log"
|
||||
# end
|
||||
def tail(file)
|
||||
run "tail -f #{file}" do |ch, stream, out|
|
||||
puts out if stream == :out
|
||||
if stream == :err
|
||||
puts "[err : #{ch[:host]}] #{out}"
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Deletes the given file from all servers targetted by the current task.
|
||||
# If <tt>:recursive => true</tt> is specified, it may be used to remove
|
||||
# directories.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue