Display git revision in your Rails application footer
06 Nov 2013 →
It’s always nice to know which version of your code is deployed. When your product owner discovers a bug in your staging/test instance especially, you want to know “what version was that?”. Or, more importantly, “who checked in and deployed that code?!”.
In our apps, we’ve taken to adding the git revision and Rails environment to our application footers. We use a four-tier system (DEV, TST, ENT, and PRD) so knowing which environment your app is running in sometimes gets confusing. Our template system includes a partial that includes both of these bits of info:
Each of our Rails apps include an intitializer that grabs the REVISION
file
that capistrano creates during a deploy:
If you don’t use capistrano, you can always shell out to git (like we do to grab the short SHA1):
Then you can include an application partial with content like this:
comments powered by Disqus