summaryrefslogtreecommitdiff
path: root/config/recipes/check.rb
blob: 45a6e1fd0e5bf051bcc274fa7e0be4b88866cd15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
namespace :check do
  desc "Make sure local git is in sync with remote."
  task :revision, roles: :web do
    unless `git rev-parse HEAD` == `git rev-parse origin/#{branch}`
      puts "WARNING: HEAD is not the same as origin/#{branch}"
      puts "Run `git push` to sync changes."
      exit
    end
  end
  before "deploy", "check:revision"
  before "deploy:migrations", "check:revision"
  before "deploy:cold", "check:revision"
end