-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (44 loc) · 1.63 KB
/
Makefile
File metadata and controls
59 lines (44 loc) · 1.63 KB
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
# Copyright (c) 2020 Red Hat, Inc.
# Copyright Contributors to the Open Cluster Management project
PWD := $(shell pwd)
LOCAL_BIN ?= $(PWD)/bin
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.28.x
# Keep an existing GOPATH, make a private one if it is undefined
GOPATH_DEFAULT := $(PWD)/.go
export GOPATH ?= $(GOPATH_DEFAULT)
GOBIN_DEFAULT := $(GOPATH)/bin
export GOBIN ?= $(GOBIN_DEFAULT)
export PATH := $(LOCAL_BIN):$(GOBIN):$(PATH)
include build/common/Makefile.common.mk
############################################################
# clean section
############################################################
.PHONY: clean
clean:
-rm bin/*
-rm -r vendor/
############################################################
# format section
############################################################
.PHONY: fmt
fmt:
############################################################
# lint section
############################################################
.PHONY: lint
lint:
############################################################
# test section
############################################################
.PHONY: test
test: envtest
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test $(TESTARGS) ./...
.PHONY: test-coverage
test-coverage: TESTARGS = -cover -covermode=atomic -coverprofile=coverage.out -coverpkg=$(shell cat go.mod | head -1 | cut -d ' ' -f 2)/...
test-coverage: test
.PHONY: gosec-scan
gosec-scan:
.PHONY: testdata/crds.yaml
testdata/crds.yaml: kustomize
$(KUSTOMIZE) build testdata/crds-kustomize > testdata/crds.yaml