forked from GoogleCloudPlatform/metacontroller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (52 loc) · 1.98 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
TAG = dev
PKG := metacontroller.app
API_GROUPS := metacontroller/v1alpha1
all: install
install: generated_files
go install
unit-test:
pkgs="$$(go list ./... | grep -v '/test/integration/\|/examples/')" ; \
go test -i $${pkgs} && \
go test $${pkgs}
integration-test:
go test -i ./test/integration/...
PATH="$(PWD)/hack/bin:$(PATH)" go test ./test/integration/... -v -timeout 5m -args -v=6
image: generated_files
docker build -t metacontroller/metacontroller:$(TAG) .
push: image
docker push metacontroller/metacontroller:$(TAG)
# Code generators
# https://github.com/kubernetes/community/blob/master/contributors/devel/api_changes.md#generate-code
generated_files: deepcopy clientset lister informer
# also builds vendored version of deepcopy-gen tool
deepcopy:
@go install ./vendor/k8s.io/code-generator/cmd/deepcopy-gen
@echo "+ Generating deepcopy funcs for $(API_GROUPS)"
@deepcopy-gen \
--input-dirs $(PKG)/apis/$(API_GROUPS) \
--output-file-base zz_generated.deepcopy
# also builds vendored version of client-gen tool
clientset:
@go install ./vendor/k8s.io/code-generator/cmd/client-gen
@echo "+ Generating clientsets for $(API_GROUPS)"
@client-gen \
--fake-clientset=false \
--input $(API_GROUPS) \
--input-base $(PKG)/apis \
--clientset-path $(PKG)/client/generated/clientset
# also builds vendored version of lister-gen tool
lister:
@go install ./vendor/k8s.io/code-generator/cmd/lister-gen
@echo "+ Generating lister for $(API_GROUPS)"
@lister-gen \
--input-dirs $(PKG)/apis/$(API_GROUPS) \
--output-package $(PKG)/client/generated/lister
# also builds vendored version of informer-gen tool
informer:
@go install ./vendor/k8s.io/code-generator/cmd/informer-gen
@echo "+ Generating informer for $(API_GROUPS)"
@informer-gen \
--input-dirs $(PKG)/apis/$(API_GROUPS) \
--output-package $(PKG)/client/generated/informer \
--versioned-clientset-package $(PKG)/client/generated/clientset/internalclientset \
--listers-package $(PKG)/client/generated/lister