forked from bakins/gearman-exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
28 lines (22 loc) · 822 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
NAME := gearman-exporter
PLATFORMS := linux/amd64 darwin/amd64
VERSION := $(shell git describe --tags --abbrev=0)
temp = $(subst /, ,$@)
os = $(word 1, $(temp))
arch = $(word 2, $(temp))
.PHONY: build
build: $(PLATFORMS)
.PHONY: $(PLATFORMS)
$(PLATFORMS):
GOFLAGS=-mod=vendor CGO_ENABLED=0 GOOS=$(os) GOARCH=$(arch) go build -o $(NAME).$(os).$(arch) ./cmd/$(NAME)
.PHONY: docker-build
docker-build:
docker build -t gearmanexporter/gearman-exporter:latest .
.PHONY: docker-push
docker-push:
docker login -u "$(DOCKER_USERNAME)" -p "$(DOCKER_PASSWORD)"
docker tag gearmanexporter/gearman-exporter:latest gearmanexporter/gearman-exporter:$(VERSION)
docker push gearmanexporter/gearman-exporter:latest
docker push gearmanexporter/gearman-exporter:$(VERSION)
lint:
GOFLAGS=-mod=readonly golangci-lint run -v ./...