language: go

sudo: required

services:
  - docker

go:
  - 1.5
  - 1.6
  - 1.7
  - tip

matrix:
  include:
  - go: 1.7
    env: BUILD_DOCKER=1

install:
  - go get github.com/gordonklaus/ineffassign
  - go get github.com/bradfitz/goimports
  - go get golang.org/x/tools/cmd/cover
  - go get github.com/mattn/goveralls
  - docker build -t crenz/mqttrules docker/default

script:
  - go get -t -v ./...
  - export PATH=$PATH:$HOME/gopath/bin
  - sh test/gosweep.sh
  - $HOME/gopath/bin/goveralls -coverprofile=profile.cov -service=travis-ci

after_success:
  - if [ "$TRAVIS_BRANCH" == "master" ] && [ "$BUILD_DOCKER" ]; then
    docker login -u="$DOCKER_USER" -p="$DOCKER_PASS";
    docker push crenz/mqttrules;
    fi
language: go

sudo: required

services:
  - docker

go:
  - 1.5
  - 1.6
  - 1.7
  - tip

env:
 - BUILD_DOCKER_IMAGES=0
 - BUILD_DOCKER_IMAGES=1

matrix:
  exclude:
  - go: 1.5
    env: BUILD_DOCKER_IMAGES=1
  - go: 1.6
    env: BUILD_DOCKER_IMAGES=1
  - go: tip
    env: BUILD_DOCKER_IMAGES=1

install:
  - go get github.com/gordonklaus/ineffassign
  - go get github.com/bradfitz/goimports
  - go get golang.org/x/tools/cmd/cover
  - go get github.com/mattn/goveralls
  - docker build -t crenz/mqttrules docker/default

script:
  - go get -t -v ./...
  - export PATH=$PATH:$HOME/gopath/bin
  - sh test/gosweep.sh
  - $HOME/gopath/bin/goveralls -coverprofile=profile.cov -service=travis-ci

after_success:
  - if [ "$TRAVIS_BRANCH" == "master" ] && [ "BUILD_DOCKER_IMAGES" ]; then
    docker login -u="$DOCKER_USER" -p="$DOCKER_PASS";
    docker push crenz/mqttrules;
    fi
Build Docker image only once
Build Docker image only once
