2017-08-09 12:57:39 -07:00
|
|
|
# Copyright 2017 The Rook Authors. All rights reserved.
|
|
|
|
|
#
|
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
|
#
|
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
#
|
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
|
|
|
|
# the helm charts to build
|
2021-05-08 18:36:59 -07:00
|
|
|
HELM_CHARTS ?= rook-ceph rook-ceph-cluster
|
2017-08-10 13:26:45 -07:00
|
|
|
HELM_BASE_URL ?= https://charts.rook.io
|
2021-01-15 23:33:04 -08:00
|
|
|
HELM_S3_BUCKET ?= rook.chart
|
2021-09-22 10:37:07 +02:00
|
|
|
HELM_CHARTS_DIR ?= $(ROOT_DIR)/deploy/charts
|
2017-08-09 12:57:39 -07:00
|
|
|
HELM_OUTPUT_DIR ?= $(OUTPUT_DIR)/charts
|
|
|
|
|
|
|
|
|
|
HELM_HOME := $(abspath $(CACHE_DIR)/helm)
|
2021-07-07 20:08:08 +05:30
|
|
|
HELM_VERSION := v3.6.2
|
2017-08-09 12:57:39 -07:00
|
|
|
HELM := $(TOOLS_HOST_DIR)/helm-$(HELM_VERSION)
|
|
|
|
|
HELM_INDEX := $(HELM_OUTPUT_DIR)/index.yaml
|
|
|
|
|
export HELM_HOME
|
|
|
|
|
|
|
|
|
|
$(HELM_OUTPUT_DIR):
|
|
|
|
|
@mkdir -p $@
|
|
|
|
|
|
|
|
|
|
$(HELM):
|
|
|
|
|
@echo === installing helm
|
|
|
|
|
@mkdir -p $(TOOLS_HOST_DIR)/tmp
|
2021-11-02 18:54:58 +01:00
|
|
|
@curl -sL https://get.helm.sh/helm-$(HELM_VERSION)-$(shell go env GOHOSTOS)-$(GOHOSTARCH).tar.gz | tar -xz -C $(TOOLS_HOST_DIR)/tmp
|
|
|
|
|
@mv $(TOOLS_HOST_DIR)/tmp/$(shell go env GOHOSTOS)-$(GOHOSTARCH)/helm $(HELM)
|
2017-08-09 12:57:39 -07:00
|
|
|
@rm -fr $(TOOLS_HOST_DIR)/tmp
|
|
|
|
|
|
|
|
|
|
define helm.chart
|
|
|
|
|
$(HELM_OUTPUT_DIR)/$(1)-$(VERSION).tgz: $(HELM) $(HELM_OUTPUT_DIR) $(shell find $(HELM_CHARTS_DIR)/$(1) -type f)
|
|
|
|
|
@echo === helm package $(1)
|
2021-09-30 15:23:35 -06:00
|
|
|
@rm -rf $(OUTPUT_DIR)/$(1)
|
|
|
|
|
@cp -aL $(HELM_CHARTS_DIR)/$(1) $(OUTPUT_DIR)
|
2021-07-26 16:40:28 -06:00
|
|
|
@$(SED_IN_PLACE) 's|VERSION|$(VERSION)|g' $(OUTPUT_DIR)/$(1)/values.yaml
|
2020-05-28 22:06:48 +00:00
|
|
|
@$(HELM) lint $(abspath $(OUTPUT_DIR)/$(1)) --set image.tag=$(VERSION)
|
2021-10-27 11:51:26 -06:00
|
|
|
@$(HELM) package --version $(VERSION) --app-version $(VERSION) -d $(HELM_OUTPUT_DIR) $(abspath $(OUTPUT_DIR)/$(1))
|
2017-08-09 12:57:39 -07:00
|
|
|
$(HELM_INDEX): $(HELM_OUTPUT_DIR)/$(1)-$(VERSION).tgz
|
|
|
|
|
endef
|
|
|
|
|
$(foreach p,$(HELM_CHARTS),$(eval $(call helm.chart,$(p))))
|
|
|
|
|
|
|
|
|
|
$(HELM_INDEX): $(HELM) $(HELM_OUTPUT_DIR)
|
|
|
|
|
@echo === helm index
|
|
|
|
|
@$(HELM) repo index $(HELM_OUTPUT_DIR)
|
|
|
|
|
|
2017-08-10 13:26:45 -07:00
|
|
|
helm.build: $(HELM_INDEX)
|