Last active
December 15, 2015 12:29
-
-
Save edooley/5260850 to your computer and use it in GitHub Desktop.
My approach to Rails app versioning. Keep up with your VCS tags and forget about the rest! (git shown here)
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
# Only attempt update on local machine | |
if Rails.env.development? | |
# Update version file from latest git tag | |
File.open('config/version', 'w') do |file| | |
file.write `git describe --tags --always` # or equivalent | |
end | |
end | |
config.version = File.read('config/version') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment