Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to properly define multiple env variables for all jobs on .travis.yml

Tags:

travis-ci

The documentation says:

When you define multiple variables per line in the env array (matrix variables), one build is triggered per item.

rvm:
  - 1.9.3
  - rbx
env:
  - FOO=foo BAR=bar
  - FOO=bar BAR=foo

But what if I define only 1 per line? I'm doing the following:

env: 
  - FOO=1
  - BAR=2
  - BAZ=3

But it's triggering 3 builds? I expected it to trigger 1 build, with those 3 env variables. Do I have to defined them like this?

env:
  - FOO=1 BAR=2 BAZ=3 QUX=4 ........ =10

Or am I missing something here?

like image 660
Christopher Francisco Avatar asked Oct 27 '16 21:10

Christopher Francisco


1 Answers

You need to define them as global variables:

env:
  global:
    - FOO=1
    - BAR=2
    - BAZ=3

See Global variables documentation for more info.

like image 165
Edenhill Avatar answered Oct 16 '22 23:10

Edenhill