Remembering git commit, tag, release information for display at runtime

28 views
Skip to first unread message

Tom Harrison

unread,
Dec 10, 2014, 3:37:44 PM12/10/14
to capis...@googlegroups.com
Versions:
  • Ruby: 2.1.4
  • Capistrano: 3.x (latest)
  • Rake / Rails / etc: Rails 4.1 
Platform:
  • Working on.... OS X
  • Deploying to... CentOS / AWS

We're deploying one service as part of a larger system.  Each service (and environment therein) needs to be able to report its current version based on git (github) info, e.g. commit hash, tag, and/or release version ... at runtime -- a common interface for all services.  Other info like OS version, ruby/rails, database and other information can be queried at runtime ... or at deploy time and saved.

I see that there's a file written, revisions.log at the top level of the app, and also see there's a /repo directory, but this is not within the scope of what my app can access.

I probably just want to write a YAML or JSON file with all of the info I might need.

Question 1: does anyone know of an existing extension that does this kind of thing?

Question 2: any pointers or references I can jump off from?

Thanks

Tom

Lee Hambley

unread,
Dec 11, 2014, 10:14:18 AM12/11/14
to capistrano
We write a REVISION file into the target directory, why can't you use that?

--
You received this message because you are subscribed to the Google Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/4a1aae7d-24e3-40fd-86ad-d162653b46da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tom Harrison

unread,
Dec 11, 2014, 10:36:03 AM12/11/14
to capis...@googlegroups.com
Thanks Lee --

I saw this -- the file is not accessible to the web server.  

It's straightforward to write my own task to write information to a suitable location (actually, I want a whole lot more: OS, database info, external service dependencies, etc), the REVISIONS file was a helpful pattern to follow.

Tom

Lee Hambley

unread,
Dec 11, 2014, 10:37:48 AM12/11/14
to capistrano
Great Tom, glad you have everything you need!
Reply all
Reply to author
Forward
0 new messages