-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (33 loc) · 883 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
34
35
36
37
38
39
40
41
42
43
SHELL := /bin/bash
GO ?= go
GO_CMD := CGO_ENABLED=0 $(GO)
GIT_COMMIT := $(shell git rev-parse HEAD)
DOCKER_REPO ?= ghcr.io/xperimental/logging-roundtrip
DOCKER_TAG ?= dev
.PHONY: all
all: test build-binary
include .bingo/Variables.mk
.PHONY: test
test:
$(GO_CMD) test -cover ./...
.PHONY: lint
lint: $(GOLANGCI_LINT)
$(GOLANGCI_LINT) run
.PHONY: lint-fix
lint-fix: $(GOLANGCI_LINT)
$(GOLANGCI_LINT) run --fix
.PHONY: build-binary
build-binary:
$(GO_CMD) build -tags netgo -ldflags "-w -X main.GitCommit=$(GIT_COMMIT)" -o logging-roundtrip .
.PHONY: image
image:
docker buildx build -t "$(DOCKER_REPO):$(DOCKER_TAG)" --load .
.PHONY: all-images
all-images:
docker buildx build -t "$(DOCKER_REPO):$(DOCKER_TAG)" --platform linux/amd64,linux/arm64 --push .
.PHONY: tools
tools: $(BINGO) $(GOLANGCI_LINT)
@echo Tools built.
.PHONY: clean
clean:
rm -f logging-roundtrip