forked from GoogleContainerTools/kpt-config-sync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.reconcilermanager
71 lines (62 loc) · 3.28 KB
/
Makefile.reconcilermanager
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
CONTROLLER_GEN_VERSION := v0.13.0
CONTROLLER_GEN := $(BIN_DIR)/controller-gen
.PHONY: generate
# Generate DeepCopy and runtime.Object implementation methods.
generate: "$(CONTROLLER_GEN)"
"$(CONTROLLER_GEN)" \
object:headerFile="hack/boilerplate.txt" \
paths="./pkg/api/configsync/v1alpha1" \
paths="./pkg/api/configsync/v1beta1" \
paths="./pkg/api/kpt.dev/v1alpha1" \
paths="./pkg/api/configmanagement/v1"
.PHONY: configsync-crds
# Generate configsync CRDs and then patch them with kustomize
configsync-crds: "$(CONTROLLER_GEN)" "$(KUSTOMIZE)" "$(ADDLICENSE)"
"$(CONTROLLER_GEN)" crd \
paths="./pkg/api/configsync/v1alpha1" \
paths="./pkg/api/configsync/v1beta1" \
paths="./pkg/api/configmanagement/v1" \
paths="./pkg/api/kpt.dev/v1alpha1" \
output:artifacts:config=./manifests \
&& mv ./manifests/configsync.gke.io_reposyncs.yaml ./manifests/patch/reposync-crd.yaml \
&& mv ./manifests/configsync.gke.io_rootsyncs.yaml ./manifests/patch/rootsync-crd.yaml \
&& mv ./manifests/configmanagement.gke.io_clusterselectors.yaml ./manifests/patch/cluster-selector-crd.yaml \
&& mv ./manifests/configmanagement.gke.io_hierarchyconfigs.yaml ./manifests/patch/hierarchyconfig-crd.yaml \
&& mv ./manifests/configmanagement.gke.io_namespaceselectors.yaml ./manifests/patch/namespace-selector-crd.yaml \
&& mv ./manifests/kpt.dev_resourcegroups.yaml ./manifests/patch/resourcegroup-crd.yaml \
&& "$(KUSTOMIZE)" build ./manifests/patch -o ./manifests \
&& mv ./manifests/*customresourcedefinition_rootsyncs* ./manifests/rootsync-crd.yaml \
&& mv ./manifests/*customresourcedefinition_reposyncs* ./manifests/reposync-crd.yaml \
&& mv ./manifests/*customresourcedefinition_clusterselectors* ./manifests/cluster-selector-crd.yaml \
&& mv ./manifests/*customresourcedefinition_hierarchyconfigs* ./manifests/hierarchyconfig-crd.yaml \
&& mv ./manifests/*customresourcedefinition_namespaceselectors* ./manifests/namespace-selector-crd.yaml \
&& mv ./manifests/*customresourcedefinition_resourcegroups* ./manifests/resourcegroup-crd.yaml \
&& rm ./manifests/patch/reposync-crd.yaml \
&& rm ./manifests/patch/rootsync-crd.yaml \
&& rm ./manifests/patch/cluster-selector-crd.yaml \
&& rm ./manifests/patch/hierarchyconfig-crd.yaml \
&& rm ./manifests/patch/namespace-selector-crd.yaml \
&& rm ./manifests/patch/resourcegroup-crd.yaml \
&& rm ./manifests/configmanagement.gke.io_clusterconfigs.yaml \
&& rm ./manifests/configmanagement.gke.io_namespaceconfigs.yaml \
&& rm ./manifests/configmanagement.gke.io_repoes.yaml \
&& rm ./manifests/configmanagement.gke.io_syncs.yaml \
&& "$(ADDLICENSE)" ./manifests
"$(CONTROLLER_GEN)": buildenv-dirs
GOPATH="$(GO_DIR)" go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_GEN_VERSION)
.PHONY: install-controller-gen
# install controller-gen (user-friendly target alias)
install-controller-gen: "$(CONTROLLER_GEN)"
.PHONY: clean-controller-gen
clean-controller-gen:
@rm -rf $(CONTROLLER_GEN)
.PHONY: generate-in-docker
# Run make generate-in-docker in the docker buildenv container
generate-in-docker: buildenv-dirs
@docker run $(DOCKER_RUN_ARGS) \
make generate
.PHONY: configsync-crds-in-docker
# Run make configsync-crds in the docker buildenv container
configsync-crds-in-docker: buildenv-dirs
@docker run $(DOCKER_RUN_ARGS) \
make configsync-crds