mirror of
https://github.com/digitalocean/ceph_exporter
synced 2025-02-27 16:50:28 +00:00
travis: fix docker push, add default page
This commit is contained in:
parent
d5a8c64171
commit
2d86f232a4
@ -24,10 +24,12 @@ script:
|
|||||||
- go test -coverprofile=collectors.coverprofile ./collectors
|
- go test -coverprofile=collectors.coverprofile ./collectors
|
||||||
- $HOME/gopath/bin/gover
|
- $HOME/gopath/bin/gover
|
||||||
- $HOME/gopath/bin/goveralls -coverprofile=gover.coverprofile -service travis-ci
|
- $HOME/gopath/bin/goveralls -coverprofile=gover.coverprofile -service travis-ci
|
||||||
- docker build -t digitalocean/ceph_exporter .
|
|
||||||
|
|
||||||
after_success:
|
after_success:
|
||||||
- if [ "$TRAVIS_BRANCH" == "master" ]; then
|
- 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 login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
|
||||||
docker push digitalocean/ceph_exporter:$DOCKER_TAG;
|
docker push $DOCKER_REPO;
|
||||||
fi
|
fi
|
||||||
|
@ -108,7 +108,13 @@ func main() {
|
|||||||
|
|
||||||
http.Handle(*metricsPath, prometheus.Handler())
|
http.Handle(*metricsPath, prometheus.Handler())
|
||||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||||
http.Redirect(w, r, *metricsPath, http.StatusMovedPermanently)
|
w.Write([]byte(`<html>
|
||||||
|
<head><title>Ceph Exporter</title></head>
|
||||||
|
<body>
|
||||||
|
<h1>Ceph Exporter</h1>
|
||||||
|
<p><a href='` + *metricsPath + `'>Metrics</a></p>
|
||||||
|
</body>
|
||||||
|
</html>`))
|
||||||
})
|
})
|
||||||
|
|
||||||
log.Printf("Starting ceph exporter on %q", *addr)
|
log.Printf("Starting ceph exporter on %q", *addr)
|
||||||
|
Loading…
Reference in New Issue
Block a user