language: java

sudo: required

services:
  - docker

jdk:
  - oraclejdk8

script:
  - ./gradlew check installDist
  - cp docker/Dockerfile georocket-server/build/install/Dockerfile
  - docker build -t georocket/georocket georocket-server/build/install
  - export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_BRANCH ; fi`
  - docker tag georocket/georocket georocket/georocket:$TAG
  - docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
  - docker push georocket/georocket

cache:
  directories:
    - $HOME/.gradle

language: java

sudo: required

services:
  - docker

jdk:
  - oraclejdk8

script:
  - ./gradlew check installDist
  - cp docker/Dockerfile georocket-server/build/install/Dockerfile
  - export REPO=georocket/georocket
  - export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_BRANCH ; fi`
  - docker build -t $REPO:$COMMIT georocket-server/build/install
  - docker tag $REPO:$COMMIT $REPO:$TAG
  - docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
  - docker push $REPO

cache:
  directories:
    - $HOME/.gradle

Improve Docker build process on Travis CI
Improve Docker build process on Travis CI
