Permalink
Browse files

adding alert when deploying and git changes aren't pushed

  • Loading branch information...
1 parent dec3034 commit cb81c88de11ad4d4fe6726070e6b3186ab650f44 @ryanb committed Sep 9, 2009
Showing with 10 additions and 0 deletions.
  1. +10 −0 config/deploy.rb
View
@@ -47,8 +47,18 @@
task :update_crontab, :roles => :db do
run "cd #{release_path} && whenever --update-crontab #{application}"
end
+
+ desc "Make sure there is something to deploy"
+ task :check_revision, :roles => :web do
+ unless `git rev-parse HEAD` == `git rev-parse origin/master`
+ puts "WARNING: HEAD is not the same as origin/master"
+ puts "Run `git push` to sync changes."
+ exit
+ end
+ end
end
+before "deploy", "deploy:check_revision"
after "deploy", "deploy:cleanup" # keeps only last 5 releases
after "deploy:setup", "deploy:setup_shared"
after "deploy:update_code", "deploy:symlink_extras"

0 comments on commit cb81c88

Please sign in to comment.