-
-
Save kennethkalmer/49178 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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