@@ -31,10 +31,23 @@ DOCKERFILE := Dockerfile
3131DOCKERTESTFILE := Dockerfile.test
3232DOCKERDURATIONTESTFILE := tests/duration/Dockerfile
3333
34+ HELM ?= $(shell which helm)
35+
36+ .PHONY : helm
37+ helm :
38+ ifeq ($(HELM ) ,)
39+ $(error Before templating you need to install helm in PATH or export helm binary using "export HELM=<path to helm>")
40+ endif
41+
42+ HELM_PACKAGE_CMD = $(HELM ) package "$(ROOTDIR ) /chart/$(CHART_NAME ) " \
43+ -d "$(ROOTDIR ) /bin/charts" \
44+ --save=false
45+
3446HELM_CMD = $(HELM ) template "$(ROOTDIR ) /chart/$(CHART_NAME ) " \
3547 --name "$(NAME ) " \
3648 --set "operator.image=$(OPERATORIMAGE ) " \
3749 --set "operator.imagePullPolicy=Always" \
50+ --set "operator.resources=null" \
3851 --namespace "$(DEPLOYMENTNAMESPACE ) "
3952
4053ifndef LOCALONLY
@@ -203,59 +216,64 @@ endif
203216.PHONY : manifests-crd
204217manifests-crd : export CHART_NAME := kube-arangodb-crd
205218manifests-crd : export NAME := crd
206- manifests-crd :
219+ manifests-crd : helm
207220 @echo Building manifests for CRD - $(MANIFESTPATHCRD )
208221 @$(HELM_CMD ) > " $( MANIFESTPATHCRD) "
209222
210223.PHONY : manifests-test
211224manifests-test : export CHART_NAME := kube-arangodb-test
212225manifests-test : export NAME := arangodb-test
213- manifests-test :
226+ manifests-test : helm
214227 @echo Building manifests for test - $(MANIFESTPATHTEST )
215228 @$(HELM_CMD ) > " $( MANIFESTPATHTEST) "
216229
217230.PHONY : manifests-operator-deployment
218231manifests-operator-deployment : export CHART_NAME := kube-arangodb
219232manifests-operator-deployment : export NAME := deployment
220- manifests-operator-deployment :
233+ manifests-operator-deployment : helm
221234 @echo Building manifests for Operator Deployment - $(MANIFESTPATHDEPLOYMENT )
222235 @$(HELM_CMD ) \
223- --set " rbac.scope=ClusterRole" \
224236 --set " operator.features.deployment=true" \
225237 --set " operator.features.deploymentReplications=false" \
226- --set " operator.features.storage=false" > " $( MANIFESTPATHDEPLOYMENT) "
238+ --set " operator.features.storage=false" > " $( MANIFESTPATHDEPLOYMENT) "
227239
228240.PHONY : manifests-operator-deployment-replication
229241manifests-operator-deployment-replication : export CHART_NAME := kube-arangodb
230242manifests-operator-deployment-replication : export NAME := deployment-replication
231- manifests-operator-deployment-replication :
243+ manifests-operator-deployment-replication : helm
232244 @echo Building manifests for Operator Deployment Replication - $(MANIFESTPATHDEPLOYMENTREPLICATION )
233245 @$(HELM_CMD ) \
234- --set " rbac.scope=ClusterRole" \
235246 --set " operator.features.deployment=false" \
236247 --set " operator.features.deploymentReplications=true" \
237- --set " operator.features.storage=false" > " $( MANIFESTPATHDEPLOYMENTREPLICATION) "
248+ --set " operator.features.storage=false" > " $( MANIFESTPATHDEPLOYMENTREPLICATION) "
238249
239250.PHONY : manifests-operator-storage
240251manifests-operator-storage : export CHART_NAME := kube-arangodb
241252manifests-operator-storage : export NAME := storage
242- manifests-operator-storage :
253+ manifests-operator-storage : helm
243254 @echo Building manifests for Operator Storage - $(MANIFESTPATHSTORAGE )
244255 @$(HELM_CMD ) \
245- --set " rbac.scope=ClusterRole" \
246256 --set " operator.features.deployment=false" \
247257 --set " operator.features.deploymentReplications=false" \
248- --set " operator.features.storage=true" > " $( MANIFESTPATHSTORAGE) "
258+ --set " operator.features.storage=true" > " $( MANIFESTPATHSTORAGE) "
249259
250260.PHONY : manifests-operator
251261manifests-operator : manifests-operator-deployment manifests-operator-deployment-replication manifests-operator-storage
252262
253- .PHONY : manifests
254- manifests : manifests-crd manifests-operator manifests-test
263+ .PHONY : chart-crd
264+ chart-crd : export CHART_NAME := kube-arangodb-crd
265+ chart-crd : helm
266+ @mkdir -p " $( ROOTDIR) /bin/charts"
267+ @$(HELM_PACKAGE_CMD )
268+
269+ .PHONY : chart-operator
270+ chart-operator : export CHART_NAME := kube-arangodb
271+ chart-operator : helm
255272 @mkdir -p " $( ROOTDIR) /bin/charts"
256- @$(HELM ) package " $( ROOTDIR) /chart/kube-arangodb" -d " $( ROOTDIR) /bin/charts" --save=false
257- @$(HELM ) package " $( ROOTDIR) /chart/kube-arangodb-crd" -d " $( ROOTDIR) /bin/charts" --save=false
273+ @$(HELM_PACKAGE_CMD )
258274
275+ .PHONY : manifests
276+ manifests : helm manifests-crd manifests-operator manifests-test chart-crd chart-operator
259277
260278# Testing
261279
0 commit comments