forked from observatorium/observatorium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
68 lines (52 loc) · 1.63 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
56
57
58
59
60
61
62
63
64
65
66
67
include .bingo/Variables.mk
CONFIGURATION_DIR ?= ./configuration
CONFIGURATION_GO_DIR ?= ./configuration_go
WEBSITE_DIR ?= website
WEBSITE_BASE_URL ?= https://observatorium.io
MD_FILES_TO_FORMAT = $(shell find docs -name "*.md") $(shell ls *.md)
MDOX_CONFIG ?= .mdox.validate.yaml
MDOX_TRANSFORM_CONFIG ?= .mdox.yaml
all: generate validate
.PHONY: fmt
fmt:
@$(MAKE) -C $(CONFIGURATION_DIR) fmt
.PHONY: lint
lint:
@$(MAKE) -C $(CONFIGURATION_DIR) lint
.PHONY: generate
generate:
@$(MAKE) -C $(CONFIGURATION_DIR) generate
$(CONFIGURATION_DIR)/tests/manifests:
@$(MAKE) -C $(CONFIGURATION_DIR) tests/manifests
.PHONY: validate
validate:
@$(MAKE) -C $(CONFIGURATION_DIR) validate
.PHONY: vendor
vendor:
@$(MAKE) -C $(CONFIGURATION_DIR) vendor
.PHONY: docs
docs: $(MDOX)
@echo ">> formatting docs with examples"
$(MDOX) fmt -l --links.validate.config-file=$(MDOX_CONFIG) $(MD_FILES_TO_FORMAT)
.PHONY: check-docs
check-docs: $(MDOX)
@echo ">> checking formatting and links"
$(MDOX) fmt --check -l --links.validate.config-file=$(MDOX_CONFIG) $(MD_FILES_TO_FORMAT)
.PHONY: web-pre
web-pre: $(MDOX)
@echo ">> preprocessing docs for website"
$(MDOX) transform --log.level=debug --config-file=$(MDOX_TRANSFORM_CONFIG)
@git submodule update --init --recursive
cd $(WEBSITE_DIR)/themes/doks/ && npm install && rm -rf content
.PHONY: web
web: $(HUGO) | web-pre
cd $(WEBSITE_DIR) && $(HUGO) -b $(WEBSITE_BASE_URL)
.PHONY: web-serve
web-serve: $(HUGO) | web-pre
@cd $(WEBSITE_DIR) && $(HUGO) serve
.PHONY: go-generate
go-generate:
@$(MAKE) -C $(CONFIGURATION_GO_DIR) generate
.PHONY: go-validate
go-validate:
@$(MAKE) -C $(CONFIGURATION_GO_DIR) validate