lib/tasks/deploy.rake in handshake_service-0.1.10 vs lib/tasks/deploy.rake in handshake_service-0.1.11
- old
+ new
@@ -105,9 +105,16 @@
current_branch = `git rev-parse --abbrev-ref HEAD`.chomp
branch_to_branch = (current_branch.length > 0) ? "#{current_branch}:master" : ""
puts 'Deploying site to Heroku ...'
puts "git push git@heroku.com:#{@app}.git #{branch_to_branch}"
puts `git push git@heroku.com:#{@app}.git #{branch_to_branch}`
+
+ # Set the latest app version so that caching and other code know what version of code
+ # is running. See Rails.cache.set_expanded_key method.
+ latest_commit = `git rev-parse HEAD`.first(6)
+ puts "heroku config:set RAILS_APP_VERSION=#{latest_commit} -a #{@app}"
+ puts `heroku config:set RAILS_APP_VERSION=#{latest_commit} -a #{@app}`
+
print_current_time
end
def restart
puts 'Restarting app servers ...'