-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
34 lines (27 loc) · 1020 Bytes
/
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
30
31
32
33
34
.PHONY: charts/*
ROOT := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
SUBDIRS := $(wildcard charts/*)
.PHONY: all prepare $(SUBDIRS)
# readme generator image built in `prepare`
# GENERATOR = readme-generator-for-helm
# the pre-compiled one available internally
GENERATOR_DEFAULT := readme-generator-for-helm:latest
GENERATOR ?= $(GENERATOR_DEFAULT)
GENERATOR_TAG := $(shell docker images -q $(GENERATOR))
all: $(SUBDIRS)
prepare:
@[ -z $(GENERATOR_TAG) ] \
&& [ $(GENERATOR) = $(GENERATOR_DEFAULT) ] \
&& docker build --tag readme-generator-for-helm . \
|| echo "\nUsing $(GENERATOR) with ID $(GENERATOR_TAG)"
charts/*: prepare
@echo ""
@echo "Building README for $@..."
@docker run --rm -it \
--user $$(id -u):$$(id -g) \
--volume $(ROOT)/bitnami-config.json:/config.json:ro \
--volume $(ROOT)/$@/values.yaml:/values.yaml:ro \
--volume $(ROOT)/$@/README.md:/README.md:rw \
$(GENERATOR) \
readme-generator --config=/config.json --values=/values.yaml --readme=/README.md
@echo ""