Browse Source

update makefile to work with busybox

master
Richard Hillmann 9 years ago
parent
commit
d39302183b
  1. 16
      Makefile
  2. 6
      exporter.go
  3. 5
      exporter_test.go

16
Makefile

@ -1,11 +1,15 @@
GO := GO15VENDOREXPERIMENT=1 go
pkgs = $(shell $(GO) list ./... | grep -v /vendor/)
pkgs = .
DOCKER_IMAGE_NAME ?= exporter
DOCKER_IMAGE_TAG ?= latest
all: format build test
all: get format test build
get:
@echo ">> get dependencies"
@$(GO) get
style:
@echo ">> checking code style"
@ -19,16 +23,12 @@ format:
@echo ">> formatting code"
@$(GO) fmt $(pkgs)
vet:
@echo ">> vetting code"
@$(GO) vet $(pkgs)
build:
@echo ">> building binaries"
@$(GO) build -o exporter
@$(GO) build -tags netgo -a -o exporter
docker:
@echo ">> building docker image"
@docker build -t "$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" .
.PHONY: all style format build test vet docker
.PHONY: all get style format test build docker

6
exporter.go

@ -6,6 +6,8 @@ import (
"fmt"
"io/ioutil"
"net/http"
"net/url"
"strings"
"syscall"
"time"
@ -13,8 +15,6 @@ import (
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/prometheus/common/log"
"github.com/prometheus/common/version"
"net/url"
"strings"
)
const (
@ -137,8 +137,6 @@ func (s *appScraper) stats() (*AppStats, error) {
return nil, fmt.Errorf("Invalid JSON returned, could not retreive duration.*")
}
return &stats, err
}

5
exporter_test.go

@ -1,11 +1,11 @@
package main
import (
"testing"
"net/http/httptest"
"fmt"
"net/http"
"net/http/httptest"
"reflect"
"testing"
)
func TestScraper(t *testing.T) {
@ -48,7 +48,6 @@ func TestScraper(t *testing.T) {
Count: 91905,
Sum: 4484.3037570333245,
Average: 0.024613801985478054,
},
},
ok: true,

Loading…
Cancel
Save