1

I am developing an opensource and multi-platform. I run tests on Travis to test and generate builds on these different platforms.

To use multiple OS's I have the following in my travis.yml file:

matrix: include: - os: linux dist: trusty sudo: required language: python python: 3.6.2 - os: osx sudo: required - os: windows language: python sudo: required python: 3.6.2 script: - if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then python3 myProject; fi

How do I add docker in this matrix?

The documentation says this:

services: - docker But can I put this also in my travis.yml file?

And how do I only execute certain commands in the docker instance?

For the different OS's I use - if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then python3 myProject; fi, how do I use this if function for docker?

There is enough documentation about Docker, and multi-os. But not for combining Docker and multiple os's. Thanks!

faze
  • 111
  • 4

2 Answers2

1

dist: trusty and sudo: required give you Docker. There is no need to add services: [docker]. https://docs.travis-ci.com/user/docker/ is misleading in that both are shown in the same YAML snippet. That should be fixed.

banzaiman
  • 2,631
  • 18
  • 27
0

AFAIK this is currently not possible with Travis as I was not able to find any hack to run docker on macos on travis.

Let me know if you find one.

sorin
  • 161,544
  • 178
  • 535
  • 806