ceph_exporter/.travis.yml

38 lines
1.1 KiB
YAML

language: go
sudo: required
dist: trusty
go:
- 1.9.2
env:
- DOCKER_TAG=$TRAVIS_TAG
before_install:
- wget -q -O- 'https://download.ceph.com/keys/release.asc' | sudo apt-key add -
- echo deb https://download.ceph.com/debian-luminous/ $(lsb_release -sc) main | sudo tee /etc/apt/sources.list.d/ceph.list
- sudo apt-get update
- sudo apt-get install -y librados-dev librbd-dev
install:
- go get github.com/ceph/go-ceph
- go get github.com/prometheus/client_golang/prometheus
- go get golang.org/x/tools/cmd/cover
- go get github.com/axw/gocov/gocov
- go get github.com/modocache/gover
- go get github.com/mattn/goveralls
script:
- go test -coverprofile=collectors.coverprofile ./collectors
- $HOME/gopath/bin/gover
- $HOME/gopath/bin/goveralls -coverprofile=gover.coverprofile -service travis-ci
after_success:
- export DOCKER_REPO="digitalocean/ceph_exporter"
- if [ ! -z "$TRAVIS_TAG" ]; then
docker build -t $DOCKER_REPO:$DOCKER_TAG .;
docker tag $DOCKER_REPO:$DOCKER_TAG $DOCKER_REPO:latest;
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
docker push $DOCKER_REPO;
fi