make-deploy/helm.mk

36 lines
976 B
Makefile

MANDATORY-helm = K8S_CONTEXT HELM_CHART_NAME HELM_CHART_PATH HELM_VALUES_FILE NAMESPACE
# helm
#
# deploys helm charts on k8s via helm
#
start-helm:
@- echo "\n### starting deployment with helm"
@- echo "\n### setting kubernetes context to $(K8S_CONTEXT)"
@ kubectl config use-context $(K8S_CONTEXT)
ifdef TEST_MODE
@- echo "Testing chart with 'helm template --debug'"
@ envsubst < ${HELM_VALUES_FILE} | helm template ${HELM_CHART_NAME} ${HELM_CHART_PATH} --debug --values -
endif
ifdef NAMESPACE
K8S_NAMESPACE = $(NAMESPACE)
endif
@- echo "\n### deploying helm chart"
@- echo "-- DEPLOYMENT --------------------"
@- echo " "
@- echo "Namespace: $(NAMESPACE)"
@- echo "Helm Chart: $(HELM_CHART_PATH)"
@- echo "Values File: $(HELM_VALUES_FILE)"
@- echo " "
@- echo "----------------------------------"
@ envsubst < $(HELM_VALUES_FILE) | helm upgrade $(HELM_CHART_NAME) $(HELM_CHART_PATH) -n $(NAMESPACE) --install --wait --values -
pull-helm:
# nop