sudo: required

services:
  - docker

before_script:
  - docker build --rm -t arachnysdocker/athenapdf-service-test -f weaver/Dockerfile.build weaver/
  - docker run --rm -t arachnysdocker/athenapdf-service-test go test ./...

script:
  - make build

before_deploy:
  - docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
  - docker push arachnysdocker/athenapdf
  - docker push arachnysdocker/athenapdf-service

sudo: required

services:
  - docker

before_script:
  - docker build --rm -t arachnysdocker/athenapdf-service-test -f weaver/Dockerfile.build weaver/
  - docker run --rm -t arachnysdocker/athenapdf-service-test go test ./...

script:
  - make build

after_success:
  - if [ "$TRAVIS_PULL_REQUEST" != "false" -o "$TRAVIS_BRANCH" != "master" ]; then exit 0; fi
  - docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
  - docker push arachnysdocker/athenapdf
  - docker push arachnysdocker/athenapdf-service

Fix auto push to Docker Hub
Fix auto push to Docker Hub

It should only be triggered on push to 'master' branch.
