robfig/revel — pull request #413 by abustany (2013-12-16 22:21:07+00:00)
Title: Define a REVEL_APP_VERSION variable when building

The contents of the variable are determined from the environment
variable of the same name, or from the output of "git describe" if the
environment variable is unset, and if the source is in a git repository.
The variable is defined in the "/app" module.

I use that to embed the git hash from which my app was compiled
inside the binary, without having to resort to additional Makefile tricks.

If that pull request is accepted, I'll gladly send another one to update the
documentation on the website.

To fetch the version, define a "REVEL_APP_VERSION" string variable anywhere in
your app package (for example in app/init.go).

Example:

```
package app

import (
"github.com/robfig/revel"
)

// gets defined at build time by the revel tool
var REVEL_APP_VERSION string

func init() {
revel.INFO.Println("Hello, this is version", REVEL_APP_VERSION)
}
```