-
-
Save constantine-nikolaou/176848 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
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 |
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
# 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