1. When deploying to Heroku, there is no automatic method unless you deploy the script / task. (I searched for this also in June 2012). I have a rake task that performs a deployment, part of which sets GIT_TAG and my webpage (application layout in rails) prints this on the page.
Here's how I write to the Heroku GIT_TAG var configuration configuration (using the Rake-based Rake task):
tag = `git describe master --always`.strip `heroku config:add GIT_TAG=
2. With tddium: tddium now supports "post build hook", and I am increasing their standard version to set GIT_TAG during this process. first read and execute http://blog.tddium.com/2012/05/09/heroku-continuous-deployment/ , and add something to the post_build_hook task to read the tag and set the heroku var configuration as shown:
namespace :tddium do def cmd(c) system c end desc "post_build_hook to deploy to dfc-site-qa" task :post_build_hook do ...use code verbatim from above URL (https://www.tddium.com/support/reference#customization) ... current_tag = `git describe master --always`.strip cmd "heroku config:add GIT_TAG=#{current_tag} --app XXXX" or puts "could not set GIT_TAG to #{current_tag}" ... end
Notes:
If necessary, replace the “master” in the above. In my tasks, expand the rake (happy to share), I allow deployment based on a branch or tag (convenient for bypassing the hero only for deployment from the wizard).
For tddium to launch your post_build_hook, you must deactivate the URL after deployment by doing the following: tddium suite --edit
and use the current value for "pull url", but set the "push url" to empty (or by default). This step was not mentioned in the blog link.
On your tddium homepage for the current build, you will see a link to the post_deploy_hook log file (at the very bottom of the page) that you can open and see how it arrived (for example, debug your rake task).
source share