forked from camptocamp/pingdom-exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
33 lines (27 loc) · 751 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
GO=CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go
BIN=pingdom-exporter
IMAGE=monotek/$(BIN)
DOCKER_BIN=docker
TAG=$(shell git describe --tags)
.PHONY: build
build:
$(GO) build -a --ldflags "-X main.VERSION=$(TAG) -w -extldflags '-static'" -tags netgo -o bin/$(BIN) ./cmd/$(BIN)
.PHONY: test
test:
go vet ./...
go test -coverprofile=coverage.out ./...
go tool cover -func=coverage.out
.PHONY: lint
lint:
go install golang.org/x/lint/golint@latest
golint ./...
# Build the Docker build stage TARGET
.PHONY: image
image:
$(DOCKER_BIN) build -t $(IMAGE):$(TAG) .
# Push Docker images to the registry
.PHONY: publish
publish:
$(DOCKER_BIN) push $(IMAGE):$(TAG)
$(DOCKER_BIN) tag $(IMAGE):$(TAG) $(IMAGE):latest
$(DOCKER_BIN) push $(IMAGE):latest