-
Notifications
You must be signed in to change notification settings - Fork 722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Global environment variables are not merged with matrix includes #6703
Comments
Do you have a build log URL that shows the problem you are describing here? I tested env:
global:
- excludegroup=travis-ci-exclude
- disable-xdebug=true
- lint=false
matrix:
include:
- php: hhvm
env: disable-xdebug=false
- php: nightly
env: disable-xdebug=false
- php: 7.1
env: disable-xdebug=false lint=true
- php: 7.0
- php: 5.6
env: excludegroup=travis-ci-exclude-56 (https://github.com/BanzaiMan/travis_production_test/blob/b1ddff8d948e24b602f7e8a9b55178e81c111c96/.travis.yml) and got what you expect. https://travis-ci.org/BanzaiMan/travis_production_test/builds/166555701 |
Oh. Did you mean you wanted environment variables whose names contain |
Nope I want the environment variables defined as global to be merged with the ones set in the matrix. And a build where that doesn't happen would be https://travis-ci.org/raphaelstolt/lean-package-validator/builds/166436492 and the relevant If you look at the build job for PHP 7 there are no environment variables set at all and I would expect the ones shown next, as they were set globally.
|
$ export excludegroup=travis-ci-exclude
$ export xdebug=true
$ export lint=false Notice that we are exporting The other two are exported. |
Okay didn't know that Fixed it with b279e and the global set envirionment variables are still lost. You can see it at PHP 7 where the environment variables should be Or is the global defintion faulty? env:
global:
- EXCLUDEGROUP=travis-ci-exclude
- DISABLE_XDEBUG=true
- LINT=false |
The build page (e.g., https://travis-ci.org/raphaelstolt/lean-package-validator/builds/166636690) does not show the environment variables that are set globally, since they are not defining characteristics of the jobs. They are set just fine. https://travis-ci.org/raphaelstolt/lean-package-validator/jobs/166636694#L127-L130 I don't think there is a bug here. We should deal with illegal characters, but that should be a separate issue. |
So how does one set an environment variable available on all Something that avoids the duplication of matrix:
include:
- php: hhvm
env:
- OPCODE_CACHE=apc
- php: nightly
env:
- OPCODE_CACHE=apc
- php: 7.1
env:
- OPCODE_CACHE=apc
- php: 7.0
env:
- OPCODE_CACHE=apc
- DISABLE_XDEBUG=true
- LINT=true
- php: 5.6
env:
- OPCODE_CACHE=apc
- DISABLE_XDEBUG=true
- php: 5.5
env:
- OPCODE_CACHE=apc
- DISABLE_XDEBUG=true
- php: 5.4
env:
- OPCODE_CACHE=apc
- DISABLE_XDEBUG=true
- php: 5.3
env:
- OPCODE_CACHE=apc
- DISABLE_XDEBUG=true This one is close, with a weird side effect of adding a undefined The global environement variable FOO is set via: env:
FOO=bar |
Common variables should go into |
Created an issue #6707 for dealing with invalid environment variable names. |
This might be a bug or a misconfiguration on my end.
Assumed I if have the following configuration:
On the build jobs I would expect the following environment variables set:
But it seems like the global enviroment variables are not
merged
with the ones set in the matrix include so that I end up with the following environment variables set:The text was updated successfully, but these errors were encountered: