2

I know that there are some default variables for testing with different environments, like the one (for PHP projects) like SYMFONY_VERSION.

My question is simple: would be possible to define a custom variable, for testing with a few specific version of another package (on which I'm depending on)?

I've tried:

env:
  - SYMFONY_VERSION=2.0.*
  - SYMFONY_VERSION=2.1.*
  - BUZZ_VERSION=0.6
  - BUZZ_VERSION=0.*

before_script:
  - composer require symfony/dependency-injection:${SYMFONY_VERSION} 
        kriswallsmith/buzz:${BUZZ_VERSION}

But it doesn't work, I've got a failed build due to "undefined index":

enter image description here

Madara's Ghost
  • 172,118
  • 50
  • 264
  • 308
gremo
  • 47,186
  • 75
  • 257
  • 421

1 Answers1

3

http://about.travis-ci.org/docs/user/build-configuration/#Set-environment-variables

  1. You need both symfony and buzz in one build, so they need to be placed in one line
  2. Wildcard (*) should be quoted

Summing up:

env:
  - SYMFONY_VERSION="2.0.*" BUZZ_VERSION="0.6"
  - SYMFONY_VERSION="2.1.*" BUZZ_VERSION="0.*"
dev-null-dweller
  • 29,274
  • 3
  • 65
  • 85
  • I'll try, thanks. The wildcard thing sounds strange to me. It works without quotes https://github.com/FriendsOfSymfony/FOSRest/blob/master/.travis.yml – gremo Jan 06 '13 at 23:37
  • 1
    As far as I know, the wildcard is fine unquoted as long as there is no path that matches the beginning of whatever the wildcard follows, but in general it's best to quote them for safety I think in shell scripts. – Seldaek Jan 07 '13 at 08:29