language: go

go:
  - 1.3
#  - 1.4
# see https://github.com/moovweb/gvm/pull/116 for why Go 1.4 is currently disabled

# let us have speedy Docker-based Travis workers
sudo: false

before_install:
  # Symlink below is needed for Travis CI to work correctly on personal forks of libkv
  - ln -s $HOME/gopath/src/github.com/${TRAVIS_REPO_SLUG///libkv/} $HOME/gopath/src/github.com/docker
  - go get golang.org/x/tools/cmd/vet
  - go get golang.org/x/tools/cmd/cover
  - go get github.com/mattn/goveralls
  - go get github.com/golang/lint/golint
  - go get github.com/GeertJohan/fgt

before_script:
  - script/travis_consul.sh 0.5.2 
  - script/travis_etcd.sh 2.2.0
  - script/travis_zk.sh 3.4.6

script:
  - ./consul agent -server -bootstrap-expect 1 -data-dir /tmp/consul -config-file=./config.json 1>/dev/null &
  - ./etcd/etcd --listen-client-urls 'http://0.0.0.0:4001' --advertise-client-urls 'http://127.0.0.1:4001' >/dev/null 2>&1 &
  - ./zk/bin/zkServer.sh start ./zk/conf/zoo.cfg 1> /dev/null
  - script/validate-gofmt
  - go vet ./...
  - fgt golint ./...
  - go test -v -race ./...
  - script/coverage
  - goveralls -service=travis-ci -coverprofile=goverage.report
