Skip to content

Instantly share code, notes, and snippets.

@constantine-nikolaou
Forked from ariejan/README
Created August 28, 2009 09:06
Show Gist options
  • Save constantine-nikolaou/176848 to your computer and use it in GitHub Desktop.
Save constantine-nikolaou/176848 to your computer and use it in GitHub Desktop.
You must be using git and capistrano to deploy your app. Capistrano will place a file in your Rails.root named 'REVISION'. Tested with the following capistrano setting:
set :scm, :git
set :deploy_via, :remote_cache
# config/initializers/app_version.rb
begin
APP_VERSION = "0.8.1"
File.open(File.join(Rails.root, "REVISION")) do |f|
APP_REVISION = f.read.strip
APP_REVISION_SHORT = APP_REVISION[0..6]
end
rescue
APP_REVISION = "????"
APP_REVISION_SHORT = "??"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment