-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
77 lines (56 loc) · 1.34 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
76
77
all: fmt check
DEPLOY_DIR ?= manifests
IMAGE_REGISTRY ?= quay.io/rhrazdil
IMAGE_TAG ?= latest
export GOFLAGS=-mod=vendor
export GO111MODULE=on
GO_VERSION = $(shell hack/go-version.sh)
export E2E_TEST_TIMEOUT ?= 3h
BIN_DIR = $(CURDIR)/build/_output/bin/
export GOROOT=$(BIN_DIR)/go/
export GOBIN = $(GOROOT)/bin/
export PATH := $(GOBIN):$(PATH)
GO := $(GOBIN)/go
$(GO):
hack/install-go.sh $(BIN_DIR)
fmt: whitespace goimports
goimports: $(cmd_sources) $(pkg_sources)
$(GO) run ./vendor/golang.org/x/tools/cmd/goimports -w ./pkg ./cmd ./test/ ./tools/
touch $@
whitespace: $(all_sources)
./hack/whitespace.sh --fix
touch $@
check:
./hack/check.sh
whitespace-check: $(all_sources)
./hack/whitespace.sh
touch $@
vet: $(GO) $(cmd_sources) $(pkg_sources)
$(GO) vet ./pkg/... ./cmd/... ./test/... ./tools/...
touch $@
goimports-check: $(GO) $(cmd_sources) $(pkg_sources)
$(GO) run ./vendor/golang.org/x/tools/cmd/goimports -d ./pkg ./cmd
touch $@
cluster-up:
./cluster/up.sh
cluster-down:
./cluster/down.sh
cluster-sync: generate
./cluster/kubectl.sh apply -f $(DEPLOY_DIR)/daemonset.yaml
generate:
./hack/generate.sh
cluster-clean:
./cluster/clean.sh
vendor: $(GO)
$(GO) mod tidy -compat=$(GO_VERSION)
$(GO) mod vendor
.PHONY: \
all \
check \
cluster-clean \
cluster-down \
cluster-sync \
cluster-up \
build \
image-push \
vendor \