forked from stern/stern
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (44 loc) · 1.2 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
SHELL:=/usr/bin/env bash
GO ?= GO111MODULE=on GOPROXY=https://gocenter.io go
.PHONY: build
build:
$(GO) build -o dist/stern .
TOOLS_DIR := hack/tools
TOOLS_BIN_DIR := $(TOOLS_DIR)/bin
GORELEASER_BIN := bin/goreleaser
GORELEASER := $(TOOLS_DIR)/$(GORELEASER_BIN)
GOLANGCI_LINT_BIN := bin/golangci-lint
GOLANGCI_LINT := $(TOOLS_DIR)/$(GOLANGCI_LINT_BIN)
$(GORELEASER): $(TOOLS_DIR)/go.mod
cd $(TOOLS_DIR) && $(GO) build -o $(GORELEASER_BIN) github.com/goreleaser/goreleaser
$(GOLANGCI_LINT): $(TOOLS_DIR)/go.mod
cd $(TOOLS_DIR) && $(GO) build -o $(GOLANGCI_LINT_BIN) github.com/golangci/golangci-lint/cmd/golangci-lint
.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 ./...
.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