travis-ci/travis-build — pull request #69 by gildegoma (2013-01-30 17:59:55+00:00)
Title: Export the 'build home directory' as environment variable

Following similar needs as https://github.com/travis-ci/travis-ci/issues/861, I propose here to export a `TRAVIS_BUILD_WD` environment variable (WD for *working directory*).
This could greatly help in **two aspects**:
* customizations in `.travis.yml` are fully *repository/fork independant*.
* `.travis.yml` is safe from changes in Travis *'hidden' internals* (e.g. build directory location)

Here the issue that motivated this pull request: https://github.com/cappuccino/cappuccino/pull/1728

For the second aspect, we recently had an example with https://github.com/travis-ci/travis-build/pull/60, where the path to build working directory has changed from `/home/travis/builds/owner/repo` to `/home/travis/build/owner/repo` ( **build** instead of **builds** )

**My Open Questions / Critics:**

* in `lib/travis/build/data/env.rb`: I did not find better than hard-coded value `/home/travis/build`, because
* `~/build` is indeed hard-coded in `build.sh`. Should we rather use `~/build` there as well?
* I don't know if `ENV[$HOME]` is available at **travis-build** level, and according to http://about.travis-ci.org/docs/user/ci-environment/#Environment-variables, I think it is even better not to compose with such value.
* I would be very interested to know what should be the good practice here...
* I added b09469e BTW, and realized that maybe we could add a bit more specs about the names and values of `TRAVIS_` vars in `spec/data/env_spec.rb`. Any opinion about that ?