language: python
matrix:
  include:
    - os: linux
      dist: trusty
      sudo: required
      python: '3.6'
install:
    - sudo apt-get update
    - sudo apt-get install -o Dpkg::Options::="--force-confold" --force-yes -y docker-engine
    - docker-compose --version
    - sudo rm /usr/local/bin/docker-compose
    - sudo pip install docker-compose

    # build miniworld container
    - export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_BRANCH ; fi`
    - export REPO=miniworldproject/miniworld_core
    - pushd ~/build/miniworld-project/miniworld_core
    - BRANCH=$TRAVIS_BRANCH ci/build_container.sh

    # clone miniworld_playground
    - git clone https://github.com/miniworld-project/miniworld_playground.git
    - pushd miniworld_playground
script:
    - uname -a
    # run tests
    - docker-compose up -d
    - docker-compose exec core pytest -x -s tests
after_success:
    - docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
    - export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_BRANCH ; fi`
    # push docker image
    - docker push $REPO:$TAG
language: python
matrix:
  include:
    - os: linux
      dist: trusty
      sudo: required
      python: '3.6'
install:
    - sudo apt-get update
    - sudo apt-get install -o Dpkg::Options::="--force-confold" --force-yes -y docker-engine
    - docker-compose --version
    - sudo rm /usr/local/bin/docker-compose
    - sudo pip install docker-compose

    # build miniworld container
    - export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_BRANCH ; fi`
    - export REPO=miniworldproject/miniworld_core
    - pushd ~/build/miniworld-project/miniworld_core
    - BRANCH=$TRAVIS_BRANCH ci/build_container.sh

    # clone miniworld_playground
    - git clone https://github.com/miniworld-project/miniworld_playground.git
    - pushd miniworld_playground
script:
    - uname -a
    # run tests
    - BRACH=$TRAVIS_BRANCH docker-compose up -d
    - docker-compose exec core pytest -x -s tests
after_success:
    - docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
    - export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_BRANCH ; fi`
    # push docker image
    - docker push $REPO:$TAG
after_failure:
    - docker-compose logs
Use current branch for docker-compose & include docker-compose logs
Use current branch for docker-compose & include docker-compose logs
