add migrate if chanfged and fix tail

This commit is contained in:
John Bintz 2012-06-11 11:07:10 -04:00
parent ed97055567
commit 7368b3b7fc
2 changed files with 10 additions and 1 deletions

View File

@ -0,0 +1,9 @@
namespace :rails do
desc 'Migrate the database if db/schema.rb has changed since the last revision'
task :migrate_if_changed do
if !(result = %x{git log #{current_revision}..#{revision} db/schema.rb}.strip).empty?
top.deploy.migrate
end
end
end

View File

@ -1,7 +1,7 @@
desc "Tail all or a single remote file" desc "Tail all or a single remote file"
task :tail do task :tail do
pattern = ENV["LOGFILE_PATTERN"] || "*.log" pattern = ENV["LOGFILE_PATTERN"] || "*.log"
run "tail -f #{shared_path}/log/#{ENV["LOGFILE_PATTERN"]}" do |channel, stream, data| run "tail -f #{shared_path}/log/#{pattern}" do |channel, stream, data|
puts "#{data}" puts "#{data}"
break if stream == :err break if stream == :err
end end