-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
48 lines (40 loc) · 1.45 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
export README_LINT ?= $(TMP)/README.md
export README_FILE ?= README.md
export README_YAML ?= README.yaml
export README_TEMPLATE_FILE ?= ./templates/README.md.gotmpl
export README_TEMPLATE_YAML := README.yaml
# export README_TEMPLATE_YAML := $(if $(findstring http,$(README_YAML)),$(README_YAML),$(BUILD_HARNESS_PATH)/templates/$(README_YAML))
export README_INCLUDES ?= $(file://$(shell pwd)/?type=text/plain)
## Alias for readme/build
readme: readme/build
@exit 0
readme/deps: packages/install/gomplate
@exit 0
## Create basic minimalistic .README.md template file
readme/init:
@if [ -f $(README_YAML) ]; then \
echo "$(README_YAML) already exists!"; \
else \
cp $(README_TEMPLATE_YAML) $(README_YAML) ; \
echo "$(README_YAML) created!"; \
fi;
## Verify the `README.md` is up to date
readme/lint:
@$(SELF) readme/build README_FILE=$(README_LINT) >/dev/null
@diff -ruN $(README_LINT) $(README_FILE)
@rm -f $(README_LINT)
## Create README.md by building it from README.yaml
readme/build: $(README_DEPS)
@gomplate --file $(README_TEMPLATE_FILE) \
--out $(README_FILE)
@echo "Generated $(README_FILE) from $(README_TEMPLATE_FILE) using data from $(README_TEMPLATE_YAML)"
push:
@echo Pushing to remote repoistory
${CMD} git add .
${CMD} git commit -m "Gitlab README commit"
${CMD} git push -f
docs: docs/build
@exit 0
docs/build:
@echo Generating terraform-docs Markdown tables
${CMD} terraform-docs markdown . --sort-by-required > ./docs/terraform.md