How to run tests on CentOS 7 with Travis-CI? How to run tests on CentOS 7 with Travis-CI? docker docker

How to run tests on CentOS 7 with Travis-CI?


Because of Travis CI Docker bug there is way to use new version of Docker. Thank to Dominic Jodoin from Travis CI team..travis.yml:

sudo: requiredenv:  #matrix:  - OS_TYPE=centos OS_VERSION=6 ANSIBLE_VERSION=1.9.2branches:  only:  - master#  - stableservices:  - dockerbefore_install:  - sudo apt-get update  - sudo apt-get upgrade lxc-docker  - 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 weldpua2008/docker-ansible:${OS_TYPE}${OS_VERSION}_v${ANSIBLE_VERSION}script: # Run tests in Container - sudo docker run --rm=true -v `pwd`:/ansible-apache:rw weldpua2008/docker-ansible:${OS_TYPE}${OS_VERSION}_v${ANSIBLE_VERSION} /bin/bash -c "/ansible-apache/tests/test-in-docker-image.sh ${OS_TYPE} ${OS_VERSION} ${ANSIBLE_VERSION}"notifications:  email: false


You can consider using Circle CI. It is very similar to Travis CI (integration with github, yaml configuration), but faster. And for it is for free for open source! Here are some docs about docker:

https://circleci.com/docs/docker/


Basic usage to use CentOS on Travis CI is like this.

services: docker...install: docker build --rm -t sample -f Dockerfile_centos .script: docker run --rm -t sample

You can refer below projects' cases.