language: java

sudo: false

install: true

services:
  - docker

jdk:
- oraclejdk8

before_install:
  - sudo apt-get install jq
  - wget -O ~/codacy-coverage-reporter-assembly-latest.jar $(curl https://api.github.com/repos/codacy/codacy-coverage-reporter/releases/latest | jq -r .assets[0].browser_download_url)

before_cache:
- rm -f  $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/

cache:
  directories:
  - "$HOME/.gradle/caches/"
  - "$HOME/.gradle/wrapper/"

script:
- "./gradlew test jacocoJunit5TestReport jar acceptanceTest --console=plain"

after_success:
- bash <(curl -s https://codecov.io/bash)
- java -cp ~/codacy-coverage-reporter-assembly-latest.jar com.codacy.CodacyCoverageReporter -l Java -r build/reports/jacoco/jacocoJunit5TestReport/jacocoJunit5TestReport.xml
- cd docker/release
- heroku plugins:install heroku-container-registry
- docker login -e _ -u _ --password=$HEROKU_API_KEY registry.heroku.com
- heroku container:push web --app $HEROKU_APP_NAME

language: java

sudo: false

install: true

services:
  - docker

jdk:
- oraclejdk8

before_install:
  - sudo apt-get install jq
  - wget -O ~/codacy-coverage-reporter-assembly-latest.jar $(curl https://api.github.com/repos/codacy/codacy-coverage-reporter/releases/latest | jq -r .assets[0].browser_download_url)

before_cache:
- rm -f  $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/

cache:
  directories:
  - "$HOME/.gradle/caches/"
  - "$HOME/.gradle/wrapper/"

script:
- "./gradlew test jacocoJunit5TestReport jar acceptanceTest --console=plain"

after_success:
- bash <(curl -s https://codecov.io/bash)
- java -cp ~/codacy-coverage-reporter-assembly-latest.jar com.codacy.CodacyCoverageReporter -l Java -r build/reports/jacoco/jacocoJunit5TestReport/jacocoJunit5TestReport.xml
- test "$TRAVIS_BRANCH" = "master" && sh .travis/deploy_heroku.sh

Revert "Move deploy command from script to CI file"
Revert "Move deploy command from script to CI file"

This reverts commit e67be2990ca99ce40f4b53d3c79b1ce4679e0105.
