add migrate if chanfged and fix tail
This commit is contained in:
parent
ed97055567
commit
7368b3b7fc
9
lib/cap-pack/recipes/rails/migrate_if_changed.rb
Normal file
9
lib/cap-pack/recipes/rails/migrate_if_changed.rb
Normal 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
|
||||
|
@ -1,7 +1,7 @@
|
||||
desc "Tail all or a single remote file"
|
||||
task :tail do
|
||||
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}"
|
||||
break if stream == :err
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user