language: java

notifications:
  email:
    recepients:
      - omid-ci@yahoo-inc.com
  on_success: always
  on_failure: always

jdk:
  - oraclejdk8

branches:
  only:
    - master

cache:
  directories:
    - "~/.m2"

before_script:
  # This is required to avoid failures of HBase minicluster related to Hadoop 1.x releases
  - umask 022
  - git config --global user.email "omid-ci@yahoo-inc.com"
  - git config --global user.name "Omid CI"
  - git checkout master

script:
  - mvn cobertura:cobertura
  - mkdir failedTests && find -name testng-failed.xml -exec cp -vf "{}" failedTests/ \; && [ ! -f failedTests/testng-failed.xml ]

after_success:
  - mvn coveralls:report
  - mvn -B release:prepare release:perform -Prelease_profile,hbase-0 --settings bintray-settings.xml

after_failure:
  - VERSION=`mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -v '\[' | grep SNAPSHOT` && git checkout -b "failed-build-$VERSION" && git config core.autocrlf false && git add -f */surefire-reports/* && git commit --verbose -m"Surefile output" && git push origin $VERSION:$VERSION
language: java

notifications:
  email:
    recepients:
      - omid-ci@yahoo-inc.com
  on_success: always
  on_failure: always

jdk:
  - oraclejdk8

branches:
  only:
    - master

cache:
  directories:
    - "~/.m2"

before_script:
  # This is required to avoid failures of HBase minicluster related to Hadoop 1.x releases
  - umask 022
  - git config --global user.email "omid-ci@yahoo-inc.com"
  - git config --global user.name "Omid CI"
  - git checkout master

script:
  - mvn cobertura:cobertura
  # Check if there were any unit test failures
  - mkdir failedTests && find -name testng-failed.xml -exec cp -vf "{}" failedTests/ \; && [ ! -f failedTests/testng-failed.xml ]

after_success:
  - mvn coveralls:report
  - mvn -B release:prepare release:perform -Prelease_profile,hbase-0 --settings bintray-settings.xml

after_failure:
  - VERSION=`mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -v '\[' | grep SNAPSHOT` && git checkout -b "failed-build-$VERSION" && git config core.autocrlf false && git add -f */surefire-reports/* && git commit --verbose -m"Surefile output" && git push "https://${GH_TOKEN}@github.com/yahoo/omid.git" $VERSION:$VERSION
Add git token to push to github
Add git token to push to github

Change-Id: Ib73c9eb5d144968c4d768dd1c54e77f071148930
