2016-01-06 18:40:25 +00:00
|
|
|
language: go
|
|
|
|
sudo: required
|
2019-09-19 19:49:02 +00:00
|
|
|
dist: bionic
|
2016-01-06 18:40:25 +00:00
|
|
|
|
|
|
|
go:
|
2019-12-03 22:03:22 +00:00
|
|
|
- 1.13
|
2016-01-06 18:40:25 +00:00
|
|
|
|
2016-12-29 18:45:46 +00:00
|
|
|
env:
|
|
|
|
- DOCKER_TAG=$TRAVIS_TAG
|
|
|
|
|
2016-01-06 18:40:25 +00:00
|
|
|
before_install:
|
2018-05-10 03:04:07 +00:00
|
|
|
- wget -q -O- 'https://download.ceph.com/keys/release.asc' | sudo apt-key add -
|
2019-09-19 19:49:02 +00:00
|
|
|
- echo deb https://download.ceph.com/debian-nautilus/ $(lsb_release -sc) main | sudo tee /etc/apt/sources.list.d/ceph.list
|
2016-01-06 18:40:25 +00:00
|
|
|
- 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
|
2016-05-17 19:14:50 +00:00
|
|
|
- go get golang.org/x/tools/cmd/cover
|
2016-01-22 15:41:44 +00:00
|
|
|
- go get github.com/axw/gocov/gocov
|
2016-05-17 19:14:50 +00:00
|
|
|
- go get github.com/modocache/gover
|
2016-01-22 15:41:44 +00:00
|
|
|
- go get github.com/mattn/goveralls
|
2016-01-06 18:40:25 +00:00
|
|
|
|
2016-01-22 15:41:44 +00:00
|
|
|
script:
|
2016-05-17 19:14:50 +00:00
|
|
|
- go test -coverprofile=collectors.coverprofile ./collectors
|
|
|
|
- $HOME/gopath/bin/gover
|
|
|
|
- $HOME/gopath/bin/goveralls -coverprofile=gover.coverprofile -service travis-ci
|
2016-12-09 11:24:43 +00:00
|
|
|
|
|
|
|
after_success:
|
2016-12-29 22:08:20 +00:00
|
|
|
- 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;
|
2016-12-09 11:24:43 +00:00
|
|
|
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
|
2016-12-29 22:08:20 +00:00
|
|
|
docker push $DOCKER_REPO;
|
2016-12-09 11:24:43 +00:00
|
|
|
fi
|