-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
55 lines (48 loc) · 1.5 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
49
50
51
52
53
54
55
.PHONY: default
default: format generate-docs
#
# target(s) to format files
#
.PHONY: format
format:
terraform fmt -recursive
#
# targets to generate documents
#
.PHONY: generate-docs generate-docs-inputs generate-docs-outputs generate-docs-sub-modules
generate-docs: generate-docs-inputs generate-docs-outputs generate-docs-sub-modules
# Generate document about module inputs
generate-docs-inputs:
terraform-docs markdown table \
--no-outputs \
--no-providers \
--no-requirements \
--sort-inputs-by-required \
. > docs/inputs.md
# Generate document about module outputs
generate-docs-outputs:
terraform-docs markdown table \
--no-inputs \
--no-providers \
--no-requirements \
. > docs/outputs.md
# Generate documents of sub-modules
generate-docs-sub-modules: generate-docs-cpu-node-pool-module generate-docs-gpu-node-pool-module
# Generate document of sub-module: cpu_experiments_node_pool
generate-docs-cpu-node-pool-module:
$(eval MODULE_PATH = "./modules/cpu_experiments_node_pool")
terraform-docs markdown table \
--no-header \
--no-providers \
--no-requirements \
--sort-inputs-by-required \
"$(MODULE_PATH)" > "$(MODULE_PATH)"/inputs_and_outputs.md
# Generate document of sub-module: gpu_experiments_node_pool
generate-docs-gpu-node-pool-module:
$(eval MODULE_PATH = "./modules/gpu_experiments_node_pool")
terraform-docs markdown table \
--no-header \
--no-providers \
--no-requirements \
--sort-inputs-by-required \
"$(MODULE_PATH)" > "$(MODULE_PATH)"/inputs_and_outputs.md