Files
nairobi/lib/capistrano/tasks/check_revision.cap
Manuel Maldonado 4b501ee46b Capistrano recipe
2015-08-12 01:36:42 +02:00

15 lines
545 B
Plaintext
Executable File

namespace :deploy do
desc "checks whether the currently checkout out revision matches the
remote one we're trying to deploy from"
task :check_revision do
branch = fetch(:branch)
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 or make sure you've"
puts "checked out the branch: #{branch} as you can only deploy"
puts "if you've got the target branch checked out"
exit
end
end
end