Skip to content

Instantly share code, notes, and snippets.

@kennethkalmer
Forked from matthewford/deploy.rb
Created January 19, 2009 21:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kennethkalmer/49178 to your computer and use it in GitHub Desktop.
Save kennethkalmer/49178 to your computer and use it in GitHub Desktop.
after "deploy:update_code", "deploy:write_sha1"
namespace :deploy do
desc "write sha1 to file"
task :write_sha1 do
run "cd #{latest_release} && git show-ref --hash -- refs/heads/master > #{latest_release}/config/HEAD"
end
end
git_sha1_path = "#{RAILS_ROOT}/config/HEAD"
GIT_SHA1 = if File.file?(git_sha1_path)
File.open(git_sha1_path).readlines[0]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment