# Required to run your project under the correct environment.
language: php

services:
  - docker

env:
  DOCKER_COMPOSE_VERSION: 1.8.0
  COMPOSE_PROJECT_NAME: lighthouseservice

before_install:
  - 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

# Commands to be run before your environment runs.
before_script:
  - docker-compose up -d
  - docker-compose exec -T app composer install --no-interaction --dev
  - docker-compose exec -T app php artisan storage:purge
  - docker-compose exec -T app php artisan storage:setup
  - docker-compose exec -T app php artisan torrents:import tests/Support/fixtures/exportdata.txt
  - sleep 5 # Wait for Eleastic Search to index torrents

# Commands you want to run that will verify your build.
script: docker-compose exec -T app vendor/bin/phpunit -c phpunit.xml

# allow_failures: Allow this build to fail under the specified environments.
# fast_finish: If your build fails do not continue trying to build, just stop.

# Customize when the notification emails are sent.
notifications:
    on_success: never
    on_failure: always

# Required to run your project under the correct environment.
language: php

services:
  - docker

env:
  DOCKER_COMPOSE_VERSION: 1.8.0
  COMPOSE_PROJECT_NAME: lighthouseservice

before_install:
  - 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

# Commands to be run before your environment runs.
before_script:
  - cp .env.example .env
  - docker-compose up -d
  - docker-compose exec -T app composer install --no-interaction --dev
  - docker-compose exec -T app php artisan storage:purge
  - docker-compose exec -T app php artisan storage:setup
  - docker-compose exec -T app php artisan torrents:import tests/Support/fixtures/exportdata.txt
  - sleep 5 # Wait for Eleastic Search to index torrents

# Commands you want to run that will verify your build.
script: docker-compose exec -T app vendor/bin/phpunit -c phpunit.xml

# allow_failures: Allow this build to fail under the specified environments.
# fast_finish: If your build fails do not continue trying to build, just stop.

# Customize when the notification emails are sent.
notifications:
    on_success: never
    on_failure: always

Copy .env file on Travis build
Copy .env file on Travis build
