generated from oracle/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
29 lines (23 loc) · 1.23 KB
/
Makefile
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
REPO_DIR=repo
CHART_DIR=charts
CHARTS=$(shell cd $(CHART_DIR) && find . -maxdepth 1 -mindepth 1 -type d)
SUPPORT_MATRIX_CHECKS?=true
CHART_TARBALLS=$(CHARTS:%=$(REPO_DIR)/%.tgz)
.PHONY: repository
repository: $(REPO_DIR)/index.yaml
$(REPO_DIR):
mkdir $(REPO_DIR)
.SECONDEXPANSION:
$(REPO_DIR)/%.tgz: $$(shell find $$(CHART_DIR)/$$* -type f) | $(REPO_DIR)
ifeq (${SUPPORT_MATRIX_CHECKS},true)
[ "$(basename $(notdir $@))" = "$$(yq '.name' $(CHART_DIR)/$(basename $(notdir $@))/Chart.yaml)-$$(yq '.version' $(CHART_DIR)/$(basename $(notdir $@))/Chart.yaml)" ]
[ "$$(yq '.version' $(CHART_DIR)/$(basename $(notdir $@))/Chart.yaml)" = "$$(yq '.appVersion' $(CHART_DIR)/$(basename $(notdir $@))/Chart.yaml)" ]
grep "$$(yq '.name' $(CHART_DIR)/$(basename $(notdir $@))/Chart.yaml)[[:space:]]|[[:space:]].*$$(yq '.version' $(CHART_DIR)/$(basename $(notdir $@))/Chart.yaml).*|$$" README.md
endif
$$(yq '.icon != null' $(CHART_DIR)/$(basename $(notdir $@))/Chart.yaml)
stat ./olm/$(shell yq '.icon' $(CHART_DIR)/$(basename $(notdir $@))/Chart.yaml)
helm package $(CHART_DIR)/$(basename $(notdir $@)) -d $(REPO_DIR) --dependency-update
$(REPO_DIR)/index.yaml: $(CHART_TARBALLS) $(REPO_DIR)
cd $(REPO_DIR) && helm repo index .
clean:
rm -rf $(REPO_DIR)