language: java
jdk:
  - oraclejdk8

cache:
  directories:
  - $HOME/.gradle

before_install:
  - export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
  - echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, PR=$PR, BRANCH=$BRANCH, TAG=$TRAVIS_TAG"
  - wget https://raw.githubusercontent.com/elastic/elasticsearch/v5.2.0/buildSrc/version.properties -O gradle.properties

script:
  - ./gradlew clean check

language: java
jdk:
  - oraclejdk8

cache:
  directories:
  - $HOME/.gradle

before_install:
  - export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
  - echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, PR=$PR, BRANCH=$BRANCH, TAG=$TRAVIS_TAG"
  - wget https://raw.githubusercontent.com/elastic/elasticsearch/${BRANCH/es-/v}/buildSrc/version.properties -O gradle.properties

script:
  - ./gradlew clean check

Use branch name to get ES versions
Use branch name to get ES versions
