mirror of
https://github.com/digitalocean/ceph_exporter
synced 2025-02-22 06:16:49 +00:00
Merge pull request #44 from digitalocean/add_default_path
travis: fix docker push, add default page
This commit is contained in:
commit
8bb9e09349
@ -24,10 +24,12 @@ script:
|
||||
- go test -coverprofile=collectors.coverprofile ./collectors
|
||||
- $HOME/gopath/bin/gover
|
||||
- $HOME/gopath/bin/goveralls -coverprofile=gover.coverprofile -service travis-ci
|
||||
- docker build -t digitalocean/ceph_exporter .
|
||||
|
||||
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 push digitalocean/ceph_exporter:$DOCKER_TAG;
|
||||
docker push $DOCKER_REPO;
|
||||
fi
|
||||
|
@ -108,7 +108,13 @@ func main() {
|
||||
|
||||
http.Handle(*metricsPath, prometheus.Handler())
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user