sudo: required
dist: trusty

install:
  # Update docker-engine using Ubuntu 'trusty' apt repo
  - >
    curl -sSL "https://get.docker.com/gpg" |
     sudo -E apt-key add -
  - >
    echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" |
     sudo tee -a /etc/apt/sources.list
  - sudo apt-get update
  - >
    sudo apt-get -o Dpkg::Options::="--force-confdef" \
     -o Dpkg::Options::="--force-confold" --assume-yes install --allow-unauthenticated docker-engine
  - docker version
  # Update docker-compose via pip
  #- sudo pip install docker-compose
  #- docker-compose version

  - docker build -t p2pu/learning-circles .
  - docker run --name=postgres -e POSTGRES_PASSWORD=password postgres:9.3 
  - docker ps -a

script: docker run --rm -it --name learningcircles --link postgres -e DATABASE_URL=postgres://postgres:password@postgres/lc -e SECRET_KEY=abc -e ADMIN_EMAIL=admin@localhost p2pu/learning-circles /opt/django-venv/bin/python /opt/app/manage.py test

notifications:
  email:
    on_success: change
    on_failure: change

sudo: required
dist: trusty

install:
  # Update docker-engine using Ubuntu 'trusty' apt repo
  - >
    curl -sSL "https://get.docker.com/gpg" |
     sudo -E apt-key add -
  - >
    echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" |
     sudo tee -a /etc/apt/sources.list
  - sudo apt-get update
  - >
    sudo apt-get -o Dpkg::Options::="--force-confdef" \
     -o Dpkg::Options::="--force-confold" --assume-yes install --allow-unauthenticated docker-engine
  - docker version
  # Update docker-compose via pip
  #- sudo pip install docker-compose
  #- docker-compose version

  - docker build -t p2pu/learning-circles .
  - docker run -d --name=postgres -e POSTGRES_PASSWORD=password postgres:9.3 
  - docker ps -a

script: docker run --rm -it --name learningcircles --link postgres -e DATABASE_URL=postgres://postgres:password@postgres/lc -e SECRET_KEY=abc -e ADMIN_EMAIL=admin@localhost p2pu/learning-circles /opt/django-venv/bin/python /opt/app/manage.py test

notifications:
  email:
    on_success: change
    on_failure: change

Make postgres image run as a daemon
Make postgres image run as a daemon
