sudo: required

services:
  - docker

language: python

python:
  - 3.6

env:
  DOCKER_COMPOSE_VERSION: 1.12.0

before_install:
  - sudo apt-get update
  - sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-engine
  - sudo rm /usr/local/bin/docker-compose
  - curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
  - chmod +x docker-compose
  - sudo mv docker-compose /usr/local/bin

install:
  - docker-compose up --build -d

script: >-
  docker-compose run web dockerize -wait tcp://db:3306 -timeout 120s
  bash -c "
  curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
  && chmod +x ./cc-test-reporter
  && export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
  && pip install coverage
  && ./cc-test-reporter before-build
  && coverage run manage.py test
  && coverage xml
  && if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then ./cc-test-reporter after-build; fi
  "

after_script:
  - docker-compose down

sudo: required

services:
  - docker

language: python

python:
  - 3.6

env:
  DOCKER_COMPOSE_VERSION: 1.12.0

before_install:
  - sudo apt-get update
  - sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-engine
  - sudo rm /usr/local/bin/docker-compose
  - curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
  - chmod +x docker-compose
  - sudo mv docker-compose /usr/local/bin

install:
  - docker-compose up --build -d

script: >-
  docker-compose run web dockerize -wait tcp://db:3306 -timeout 120s
  bash -c "
  curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
  && chmod +x ./cc-test-reporter
  && export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
  && pip install coverage
  && ./cc-test-reporter before-build
  && coverage run manage.py test
  && coverage xml
  && if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then ./cc-test-reporter after-build -d; fi
  "

after_script:
  - docker-compose down

Update for codeclimate test reporting
Update for codeclimate test reporting
