<p>This functionality is built straight into travis. Have a look at <a href="https://docs.travis-ci.com/user/multi-os/#TRAVIS_OS_NAME-environment-variable" rel="nofollow noreferrer">here</a>. </p>

<p>Secondly you should not need to specify a branch as part of your make script as travis will triggered on a specific branch and therefore that revision would already be checked out.</p>

CC BY-SA 4.0
2018-08-06T10:58:39.423Z
Travis supports only `trusty` from Linux and `osx` but I require `trusty`, `xenail`, `jessie` and `stretch`. These can only be done using docker I guess.
Gaurav Mishra
CC BY-SA 4.0
2018-08-05T15:36:42.017Z
2018-08-05T15:36:42.017Z
Robert
<p>I am trying to write my <code>.travis.yml</code> to perform multi platform test on Travis-CI using Docker. The platforms I want to test on:</p>

<ol>
<li>Ubuntu 14.04</li>
<li>Ubuntu 16.04</li>
<li>Debian 8</li>
<li>Debian 9</li>
</ol>

<p>The whole concept in a nutshell is (for all 4 distros):</p>

<ol>
<li><code>docker pull ubuntu:trusty</code></li>
<li><code>docker run ubuntu:trusty</code></li>
<li>Run <code>make test</code> inside the container (on my repo's clone)</li>
<li>Copy the <code>result.xml</code> back to Travis</li>
<li>Run <code>scp result.xml ${SERVER_USER}@${SERVER_ADDR}:/home/${SERVER_USER}/result/</code></li>
</ol>

<p>I know how to run scripts inside a docker container but how am I going to get the current branch inside the container and run <code>make test</code> on it make me go crazy.</p>

<p>Any help will be much appreciated!</p>

<docker><travis-ci><docker-in-docker>
Multi platform test on Travis-CI using Docker
Gaurav Mishra
# Multi platform test on Travis-CI using Docker

(Asked by: username_0 on 2018-07-20)

I am trying to write my `.travis.yml` to perform multi platform test on Travis-CI using Docker. The platforms I want to test on:

1. Ubuntu 14.04
2. Ubuntu 16.04
3. Debian 8
4. Debian 9

The whole concept in a nutshell is (for all 4 distros):

1. `docker pull ubuntu:trusty`
2. `docker run ubuntu:trusty`
3. Run `make test` inside the container (on my repo's clone)
4. Copy the `result.xml` back to Travis
5. Run `scp result.xml ${SERVER_USER}@${SERVER_ADDR}:/home/${SERVER_USER}/result/`

I know how to run scripts inside a docker container but how am I going to get the current branch inside the container and run `make test` on it make me go crazy.

Any help will be much appreciated!

**Tags:** docker, travis-ci, docker-in-docker


---

## 1 answers

### Answer by username_1 on 2018-08-05. Score: 1

This functionality is built straight into travis. Have a look at [here](https://docs.travis-ci.com/user/multi-os/#TRAVIS_OS_NAME-environment-variable).

Secondly you should not need to specify a branch as part of your make script as travis will triggered on a specific branch and therefore that revision would already be checked out.

> **Comments:**
> **username_0**: Travis supports only `trusty` from Linux and `osx` but I require `trusty`, `xenail`, `jessie` and `stretch`. These can only be done using docker I guess.  

---

