Linux using on Travis

Asked

Viewed 56 times

2

So I’m wanting to add my project in Travis, I noticed that it makes use of Ubuntu, I wonder if there is any way to compile my project in Centos and Ubuntu using Travis ?

2 answers

1

No. As the documentation itself says, only Ubuntu and OS X are available, and OS X is only used for Objective-C builds.

Of the item CI Environment OS:

Travis CI virtual machines are based on Ubuntu 12.04 LTS Server Edition 64 bit, with the Exception of Objective-C builds, which runs on Mac OS X Mavericks.

Link to documentation:

Travis CI: The Build Environment

  • Thank you for clarifying Vinicius.

0

It is possible to do this through an outline solution: Place a virtualizator within virtualization. If you add a Docker container to Travis it will be possible to run your build within any OS. The file .Travis.yml would look similar to the file below:

sudo: required
env:
  matrix:
  - OS_TYPE=centos OS_VERSION=6
  - OS_TYPE=centos OS_VERSION=7

services:
  - docker

before_install:
  - sudo apt-get update
  - echo 'DOCKER_OPTS="-H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock -s devicemapper"' | sudo tee /etc/default/docker > /dev/null
  - sudo service docker restart
  - sleep 5
  - sudo docker pull centos:centos${OS_VERSION}

script:
 # Run tests in Container
- tests/setup_tests.sh ${OS_VERSION}

Translating, you would be starting the Docker service, downloading the Centos image in the desired version and running the build or testing in the Centos Docker container.

References: https://djw8605.github.io/2016/05/03/building-centos-packages-on-travisci/

Browser other questions tagged

You are not signed in. Login or sign up in order to post.