conda/conda-build — pull request #147 by tswicegood (2014-07-24 19:16:13+00:00)
Title: Add GIT_ environment variables to conda-build

Adds the following new environment variables when building:

* `GIT_BUILD` -- boolean denoting whether a git_url has been used (detects via presence of `.git` directory in `SRC_DIR`
* `GIT_BUILD_VERSION` -- string denoting the version based solely on presence of a tag
* `GIT_BUILD_NUMBER` -- string denoting the number of commits since the most recent tag
* `GIT_BUILD_HASH` -- the current commit short-hash as displayed from `git describe --tags`
* `GIT_BUILD_STR` -- a string that joins `GIT_BUILD_NUMBER` and `GIT_BUILD_HASH` by an underscore.

These can be used in conjunction with templated `meta.yaml` files to set things like the build string based on the state of the Git repository.

For example, here's a modified wakari-app-workbench `meta.yaml` that would work with these values:

package:
name: wakari-app-workbench
version: {{ environ['GIT_BUILD_VERSION'] }}

build:
number: {{ environ.get('GIT_BUILD_NUMBER', 0) }}
string: {{ environ.get('GIT_BUILD_STR', '') }}

entry_points:
- wk-app-workbench = workbench.server:main

source:
git_url: ../