matrix:
 include:
  - os: linux
    dist: trusty
  - os: osx

language: go

go:
 - 1.9
 
install:
 - go get -t ./...

script:
 - go test -v -race -covermode=atomic ./...

go_import_path: github.com/google/cloudprober

services:
 - docker

after_success:
 - make cloudprober
 - cp /etc/ssl/certs/ca-certificates.crt .
 - test "$TRAVIS_BRANCH" = "master" && test "$TRAVIS_EVENT_TYPE" = "push" && DOCKER_VERSION=latest
 - test -n "$TRAVIS_TAG" && DOCKER_VERSION=$TRAVIS_TAG
 - test -n "$DOCKER_IMAGE" && test -n "$DOCKER_VERSION" && test "$TRAVIS_OS_NAME" = "linux" && docker build -t ${DOCKER_IMAGE}:${DOCKER_VERSION} . && docker login -u ${DOCKER_USER} -p ${DOCKER_PASS} && docker push ${DOCKER_IMAGE}

matrix:
 include:
  - os: linux
    dist: trusty
  - os: osx

language: go

go:
 - 1.9
 
install:
 - go get -t ./...

script:
 - go test -v -race -covermode=atomic ./...

go_import_path: github.com/google/cloudprober

services:
 - docker

after_success:
 - make cloudprober
 - cp /etc/ssl/certs/ca-certificates.crt .
 - test "$TRAVIS_BRANCH" = "master" && test "$TRAVIS_EVENT_TYPE" = "push" && DOCKER_VERSION=latest
 - test -n "$TRAVIS_TAG" && DOCKER_VERSION=$TRAVIS_TAG
 - test -n "$DOCKER_IMAGE" && test -n "$DOCKER_VERSION" && test "$TRAVIS_OS_NAME" = "linux" && DOCKER_VERSION=${DOCKER_VERSION} make docker_build && docker login -u ${DOCKER_USER} -p ${DOCKER_PASS} && docker push ${DOCKER_IMAGE}

Use make docker_build to build docker image.
Use make docker_build to build docker image.

Make docker_build adds build related metadata to docker image.