sudo: required
group: edge
language: python
services:
  - docker
addons:
  apt:
    packages:
      - openvswitch-switch
cache:
  directories:
    - /home/travis/docker/
before_install:
  - if [ -f ${DOCKER_CACHE_FILE} ]; then gunzip -c ${DOCKER_CACHE_FILE} | docker load; fi
env:
  global:
    - DOCKER_CACHE_FILE=/home/travis/docker/cache.tar.gz
python:
  - "3.5"
install:
  - "pip3 install -r requirements.txt -r test-requirements.txt"
  - "python3 setup.py sdist"
  - "pip3 install dist/*tar.gz"
  - "pip3 show faucet"
script:
  - "cd ./tests"
  - "PYTHONPATH='../faucet' ./test_min_pylint.sh"
  - "python3 ./test_config.py"
  - "python3 ./test_check_config.py"
  - "python3 ./test_valve.py"
  - "cd .."
  - "docker build -t reannz/faucet-tests -f Dockerfile.tests ."
  - "sudo docker run --privileged -ti reannz/faucet-tests"
  - if [[ ${TRAVIS_BRANCH} == "master" ]] && [[ ${TRAVIS_PULL_REQUEST} == "false" ]]; then mkdir -p $(dirname ${DOCKER_CACHE_FILE}) ; docker save $(docker history -q ${DOCKER_REPOSITORY}:${TRAVIS_COMMIT} | grep -v '<missing>') | gzip > ${DOCKER_CACHE_FILE}; fi

sudo: required
group: edge
language: python
services:
  - docker
addons:
  apt:
    packages:
      - openvswitch-switch
python:
  - "3.5"
install:
  - "pip3 install -r requirements.txt -r test-requirements.txt"
  - "python3 setup.py sdist"
  - "pip3 install dist/*tar.gz"
  - "pip3 show faucet"
script:
  - "cd ./tests"
  - "PYTHONPATH='../faucet' ./test_min_pylint.sh"
  - "python3 ./test_config.py"
  - "python3 ./test_check_config.py"
  - "python3 ./test_valve.py"
  - "cd .."
  - "docker build -t reannz/faucet-tests -f Dockerfile.tests ."
  - "sudo docker run --privileged -ti reannz/faucet-tests"

Revert "Try to cache docker images."
Revert "Try to cache docker images."

This reverts commit fa2d6c0a893ef8e41cb4cd154cb04ee33583724b.
