0

In the TravisCI webapp, I've specified an environment variable called "BUILD_BRANCH". I would like to use this variable in the .travis.yml branch declaration, but TravisCI is reading it as a literal string "$BUILD_BRANCH".

I've looked for examples and references of this type of usage online and couldn't find any. I've also emailed them for support but they haven't gotten back to me yet.

branches:
    only:
        - $BUILD_BRANCH

I've tried both "$BUILD_BRANCH" and "${BUILD_BRANCH}".

mattrowsboats
  • 582
  • 1
  • 6
  • 14
  • The answer here: will be sufficient for what I need, but I'd like to be able to do what I'm asking in the question. (cf. http://stackoverflow.com/questions/31338562/travisci-run-after-success-on-a-specific-branch) – mattrowsboats May 19 '17 at 16:37

1 Answers1

1

Environment variables are expanded in the build, not in the place where the build matrix is expanded in jobs to be run. You would need to hard code this value.

joepd
  • 4,681
  • 2
  • 26
  • 27