# http://elliot.land/post/using-docker-compose-on-travis-ci
env:
  # You may want to update this to whatever the latest version is, or keep it
  # the same as your local machines. However, I have only tested it with 1.8.0+.
  # There should be a time in the future when this is not necessary - it is
  # explained in more detail below.
  DOCKER_COMPOSE_VERSION: 1.23.2

sudo: required
language: generic

services:
  - docker

before_install:
  - './travis_before_install.sh'
  - docker-compose up -d
  - docker ps

script:
  - docker-compose exec app bash -c "cd /srv/shiny-server/app && Rscript run_tests.R"

after_success:
  - docker-compose down
  - docker login -u leoluyi -p $DOCKER_PASSWORD
  - docker tag leoluyi/shiny:latest leoluyi/shiny:$TRAVIS_BUILD_NUMBER
  - docker-compose push
