dist: trusty
sudo: required

language: java
jdk:
  - openjdk7
  - openjdk8
  - oraclejdk8

branches:
  except:
    - "/^v|d\\d+\\.\\d+\\.\\d+$/"
    - "/^jenkins-jhove-v|d\\d+\\.\\d+\\.\\d+$/"

notifications:
  slack:
    secure: qAKVtBCrucCt8GB1SVjjCckwWqC6zAvXN7UdT+aFLH2u7vILT4jzLibTRAaTqqcBBnxFYE87qii4uaIbIltMRZYBQUyiz/mTabkQq5RHJKzzZq54qcKjrI7BSCJHoJErBYrNO4yECUgR6wkhF2/e0+OxEtuSxFovTGXN9ycMT0c=

env:
  global:
    secure: P3baCsYCRF45nZExdjc3QzAt8PKqK9i+0M04N87I7UJgv8ibqPb2kVah/YXcRdAUxAN3vE095LALf4NszXKa3fx/QnsoyfQqnVpwmVbNM0cCScT3Du304j2XnwoSghvNT8bDlvT+qmhLr9N8xE3E6sodChMpYLNPqfJWSG1nOJY=

coverage:
  notify:
    slack:
      default:
        url: "https://hooks.slack.com/services/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"
        threshold: 1%
        only_pulls: false
        branches: null
        flags: null
        paths: null

before_install:
  - sudo apt-get install -y realpath
  - 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)

script:
  - mvn clean install -DjacocoAgg
  - "./jhove-bbt/scripts/travis-test.sh"
  - mvn verify -DjacocoAgg

after_success:
  - bash <(curl -s https://codecov.io/bash)
  - java -cp ~/codacy-coverage-reporter-assembly-latest.jar com.codacy.CodacyCoverageReporter
    -l Java -r jhove-apps/target/site/jacoco-aggregate/jacoco.xml

after_failure:
  - cat /tmp/bbt-logs/log.txt | grep --group-separator"===== Unexpected output ====="
    -n -B 1 -A 2 Expected
