-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathMakefile
51 lines (40 loc) · 1.09 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
# SPDX-FileCopyrightText: 2019 SAP SE or an SAP affiliate company and Gardener contributors
#
# SPDX-License-Identifier: Apache-2.0
TOOLS_DIR := hack/tools
include hack/tools.mk
.PHONY: tidy
tidy:
go mod tidy
.PHONY: check
check: sast-report fastcheck
.PHONY: fastcheck
fastcheck: format $(GOIMPORTS) $(GOLANGCI_LINT)
@TOOLS_BIN_DIR="$(TOOLS_DIR)/bin" ./hack/check.sh --golangci-lint-config=./.golangci.yaml ./cmd/... ./pkg/...
@echo "Running go vet..."
@go vet ./cmd/... ./pkg/...
.PHONY: build
build:
@CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
-a -v \
./pkg/... ./cmd/...
.PHONY: build-local
build-local:
@CGO_ENABLED=0 go build \
./pkg/... ./cmd/...
.PHONY: test
test: $(KUBEBUILDER_TAG) $(GINKGO)
KUBEBUILDER_ASSETS=$(KUBEBUILDER_ASSETS) ginkgo ${COVER_FLAG} -r cmd pkg plugin
.PHONY: generate
generate: $(VGOPATH)
@VGOPATH=$(VGOPATH) ./hack/generate-code
@go fmt ./cmd/... ./pkg/...
.PHONY: format
format:
@go fmt ./cmd/... ./pkg/...
.PHONY: sast
sast: $(GOSEC)
@./hack/sast.sh
.PHONY: sast-report
sast-report: $(GOSEC)
@./hack/sast.sh --gosec-report true