Permalink
Browse files

added custom deploy log task

  • Loading branch information...
1 parent 959250b commit 5b81dec095ccfc013423b6bf8965dd608761dd3b @bangline committed Nov 18, 2011
Showing with 12 additions and 1 deletion.
  1. +12 −1 config/deploy.rb
View
13 config/deploy.rb
@@ -31,6 +31,17 @@
task :restart, :roles => :app, :except => { :no_release => true } do
run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
end
+
+ task :log_deploy do
+ date = DateTime.now
+ run "cd #{shared_path};( echo '#{date.strftime("%m/%d/%Y - %I:%M%p")} : Vesrion #{latest_revision[0..6]} was deployed.' ; cat REVISION_HISTORY) > rev_tmp && mv rev_tmp REVISION_HISTORY"
+ end
+
+ task :history do
+ run "tail #{shared_path}/REVISION_HISTORY" do | ch, stream, out |
+ puts out
+ end
+ end
end
namespace :assets do
@@ -39,5 +50,5 @@
run "cd #{current_path}; bundle exec rake assets:precompile RAILS_ENV=production"
end
end
-
+after "deploy", "deploy:log_deploy"
before "deploy:restart", "assets:compile"

0 comments on commit 5b81dec

Please sign in to comment.