forked from stern/stern
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
75 lines (56 loc) · 1.64 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
SHELL:=/usr/bin/env bash
.PHONY: build
build:
go build -o dist/stern .
TOOLS_BIN_DIR := $(CURDIR)/hack/tools/bin
GORELEASER_VERSION ?= v1.11.4
GORELEASER := $(TOOLS_BIN_DIR)/goreleaser
GOLANGCI_LINT_VERSION ?= v1.49.0
GOLANGCI_LINT := $(TOOLS_BIN_DIR)/golangci-lint
VALIDATE_KREW_MAIFEST_VERSION ?= v0.4.3
VALIDATE_KREW_MAIFEST := $(TOOLS_BIN_DIR)/validate-krew-manifest
$(GORELEASER):
GOBIN=$(TOOLS_BIN_DIR) go install github.com/goreleaser/goreleaser@$(GORELEASER_VERSION)
$(GOLANGCI_LINT):
GOBIN=$(TOOLS_BIN_DIR) go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
$(VALIDATE_KREW_MAIFEST):
GOBIN=$(TOOLS_BIN_DIR) go install sigs.k8s.io/krew/cmd/validate-krew-manifest@$(VALIDATE_KREW_MAIFEST_VERSION)
.PHONY: build-cross
build-cross: $(GORELEASER)
$(GORELEASER) build --snapshot --rm-dist
.PHONY: test
test: fmt vet lint
go test -v ./...
.PHONY: lint
lint: $(GOLANGCI_LINT)
$(GOLANGCI_LINT) run
.PHONY: fmt
fmt:
go fmt ./...
.PHONY: vet
vet:
go vet ./...
README_FILE ?= ./README.md
.PHONY: update-readme
update-readme:
go run hack/update-readme/update-readme.go $(README_FILE)
.PHONY: verify-readme
verify-readme:
./hack/verify-readme.sh
.PHONY: validate-krew-manifest
validate-krew-manifest: $(VALIDATE_KREW_MAIFEST)
$(VALIDATE_KREW_MAIFEST) -manifest dist/stern.yaml -skip-install
.PHONY: dist
dist: $(GORELEASER)
$(GORELEASER) release --rm-dist --skip-publish --snapshot
.PHONY: release
release: $(GORELEASER)
$(GORELEASER) release --rm-dist --skip-validate
.PHONY: clean
clean: clean-tools clean-dist
.PHONY: clean-tools
clean-tools:
rm -rf $(TOOLS_BIN_DIR)
.PHONY: clean-dist
clean-dist:
rm -rf ./dist