Daniel Ashton
Daniel Ashton

Reputation: 1438

Is there a canonical way to embed Git tags in a Rails app?

I'm maintaining a Rails app, and I would like a way to see at a glance that a given HTML page was served from the current version of the app. I'm guessing that putting some data in the HEAD of each page would work. The cap deploy release directory name would be fine, or the tag on the head of the git branch, or . . . How do you quickly validate that your Rails app is running at the version you expect?

Upvotes: 0

Views: 73

Answers (1)

Joseph K. Strauss
Joseph K. Strauss

Reputation: 4903

I have had this issue, and I added a line in the deploy script:

git rev-parse HEAD > HEAD

In your case you would have to put the output in a place which where static fiels are visible from the web.

If you want a nicer output, try

git describe --tags > HEAD

Upvotes: 1

Related Questions