Accessing the real version number from :scm

6 views
Skip to first unread message

alancfrancis

unread,
Sep 2, 2008, 10:27:45 AM9/2/08
to Capistrano
Hi folks,

I'm using the Git SCM, and trying to display the deployed commit ID in
my deployed app on staging.

I tried using the :version property but it always contains HEAD.
There does seem to be a method on the scm instance to translate that
into a real version / commit id, but I can't figure out how to access
it from my recipe.

I'm about to start parsing it from 'git log' or something. Does
anyone have any suggestions ?

Alan

Jamis Buck

unread,
Sep 2, 2008, 11:01:14 AM9/2/08
to capis...@googlegroups.com
The :real_revision variable will resolve to an actual commit.
The :revision variable is a pseudo-revision, which defaults to
"head" (SCM-specific, of course), but which may be set to an explicit
commit by the user if they want to.

- Jamis

> --~--~---------~--~----~------------~-------~--~----~
> To unsubscribe from this group, send email to capistrano-...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/capistrano
> -~----------~----~----~----~------~----~------~--~---
>

Mislav Marohnić

unread,
Sep 2, 2008, 6:19:01 PM9/2/08
to capis...@googlegroups.com
If I got this correctly, you want your running app on staging display the commit ID somewhere on the page?
The easiest way is this:

  File.read("#{RAILS_ROOT}/REVISION")
Reply all
Reply to author
Forward
0 new messages