Travis: Define OS-specific environment variables

I use Go lang in my project and Travis-CI to create it.

I want to create it for each operating system (OSX, Linux, Windows), so I wanted to use the GIMME_OS and GIMME_ARCH environment variables ( from GIMME ), but the problem is that Darwin is not enough for my project, so I have to create my own project on Mac .

My approach is to create an OSX operating system as a virtual machine (travis supports this directly from the .travis.yml file) and build on Linux using cross-compilation (GIMME) linux64, linux386 and windows.

Now every time I define an environment variable, he created a new column for my build matrix. I want environment variables to save o in the Linux build part .

Now my .travis.yml looks like this:

 language: go go: - 1.4.2 os: - osx - linux env: - GIMME_OS=windows GIMME_ARCH=amd64 - GIMME_OS=linux GIMME_ARCH=amd64 - GIMME_OS=linux GIMME_ARCH=386 - GIMME_OS=darwin GIMME_ARCH=386 matrix: exclude: os: osx env: GIMME_OS=darwin GIMME_ARCH=386 before_script: - go get -d -v ./... script: - go build -v ./... - go test -v ./... 

These are really builds 8 (each line of environment variables for each OS) Is there a way to define environment variables that will be relevant only for some sections in the .travis.yml file (in particular, in the OS section).

+7
linux travis-ci
source share

No one has answered this question yet.

See related questions:

4800
How to find all files containing specific text in Linux?
988
How to delete exported environment variable?
703
Defining a variable with or without export
475
How to run travis-ci locally
388
Run Travis-CI recovery without clicking commit?
3
Multiple values โ€‹โ€‹of a secure encrypted environment variable in .travis.yml
3
travis-ci: matrix.exclude is ignored?
3
Travis CI + Go: creating a specific build stream for different OS
0
Use repository name in travis CI
0
Django and travis CI secret key error with environment variables travis encode

All Articles