language: java

services:
  - redis
  - mysql
  - docker

jdk:
  - openjdk8

os:
  - linux

before_script:
  - "sh -e ./ci/scripts/start-services.sh"

script:
  - CF_ENDPOINT='api.run.pivotal.io'
  - CF_ORGANIZATION='pivotal-cla'
  - CF_SPACE='production'
  - ./gradlew check
after_success:
  - |
    if [[ "${TRAVIS_PULL_REQUEST}" = "false" && $TRAVIS_BRANCH == 'master' && $TRAVIS_SECURE_ENV_VARS == 'true' ]] ; then
      ./ci/scripts/install-cf.sh
      export PATH=$PATH:$PWD
      cf login -a $CF_ENDPOINT -o $CF_ORGANIZATION -s $CF_SPACE -u $CF_USERNAME -p $CF_PASSWORD
      ./ci/scripts/cf-push.sh pivotal-cla-production $CLIENT_ID $CLIENT_SECRET $TOKEN_SECRET $TRAVIS_BUILD_NUMBER-$TRAVIS_COMMIT
    fi

after_failure: cat $PWD/build/reports/tests/*/classes/*.html

before_cache:
  - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
cache:
  directories:
    - $HOME/.gradle/caches/
    - $HOME/.gradle/wrapper/

language: java

services:
  - docker

jdk:
  - openjdk8

os:
  - linux

before_script:
  - "sh -e ./ci/scripts/start-services.sh"

script:
  - CF_ENDPOINT='api.run.pivotal.io'
  - CF_ORGANIZATION='pivotal-cla'
  - CF_SPACE='production'
  - ./gradlew check
after_success:
  - |
    if [[ "${TRAVIS_PULL_REQUEST}" = "false" && $TRAVIS_BRANCH == 'master' && $TRAVIS_SECURE_ENV_VARS == 'true' ]] ; then
      ./ci/scripts/install-cf.sh
      export PATH=$PATH:$PWD
      cf login -a $CF_ENDPOINT -o $CF_ORGANIZATION -s $CF_SPACE -u $CF_USERNAME -p $CF_PASSWORD
      ./ci/scripts/cf-push.sh pivotal-cla-production $CLIENT_ID $CLIENT_SECRET $TOKEN_SECRET $TRAVIS_BUILD_NUMBER-$TRAVIS_COMMIT
    fi

after_failure: cat $PWD/build/reports/tests/*/classes/*.html

before_cache:
  - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
cache:
  directories:
    - $HOME/.gradle/caches/
    - $HOME/.gradle/wrapper/

Remove redis and mysql from Travis since use docker
Remove redis and mysql from Travis since use docker
