-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (40 loc) · 1.68 KB
/
Copy pathMakefile
File metadata and controls
52 lines (40 loc) · 1.68 KB
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
CHART_DIR := charts/bmlt-server
SITE_DIR := site
REPO_URL := $(or $(REPO_URL), https://charts.bmlt.app)
CHART_NAME := $(shell awk '/^name:/ {print $$2; exit}' $(CHART_DIR)/Chart.yaml)
CHART_VERSION := $(shell awk '/^version:/ {print $$2; exit}' $(CHART_DIR)/Chart.yaml)
PACKAGE := $(SITE_DIR)/$(CHART_NAME)-$(CHART_VERSION).tgz
CHART_SOURCES := $(shell find $(CHART_DIR) -type f)
help: ## Print the help documentation
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: lint
lint: ## Lint the chart
helm lint $(CHART_DIR)
.PHONY: template
template: ## Render the chart with default values
helm template $(CHART_NAME) $(CHART_DIR)
$(PACKAGE): $(CHART_SOURCES)
helm lint $(CHART_DIR)
helm package $(CHART_DIR) --destination $(SITE_DIR)
.PHONY: package
package: $(PACKAGE) ## Package the chart into a .tgz under site/
.PHONY: index
index: $(PACKAGE) ## Regenerate site/index.yaml from the packaged charts
helm repo index $(SITE_DIR) --url $(REPO_URL)
.PHONY: release
release: index ## Lint, package, and regenerate the repo index
@echo "Built $(PACKAGE) and updated index.yaml — commit and push to publish."
.PHONY: clean
clean: ## Remove the .tgz for the current chart version
rm -f $(PACKAGE)
.PHONY: cluster-up
cluster-up: ## Create a local k3d cluster, deploy MariaDB, and install the chart
./test/up.sh
.PHONY: cluster-test
cluster-test: ## Smoke-test the app running in the local cluster
./test/smoke-test.sh
.PHONY: cluster-down
cluster-down: ## Delete the local k3d test cluster
./test/down.sh
.PHONY: e2e
e2e: cluster-up cluster-test ## Stand up the cluster and run the smoke test