HiveBrain v1.2.0
Get Started
← Back to all entries
patterndockerMinor

Multi platform test on Travis-CI using Docker

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
platformmultidockertravistestusing

Problem

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:

  • Ubuntu 14.04



  • Ubuntu 16.04



  • Debian 8



  • Debian 9



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

  • docker pull ubuntu:trusty



  • docker run ubuntu:trusty



  • Run make test inside the container (on my repo's clone)



  • Copy the result.xml back to Travis



  • 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!

Solution

This functionality is built straight into travis. Have a look at here.

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.

Context

StackExchange DevOps Q#4560, answer score: 1

Revisions (0)

No revisions yet.