-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
47 lines (36 loc) · 1.08 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
pages := $(shell find . -type f -name '*.adoc')
out_dir := ./_archive
web_dir := ./_public
docker_cmd ?= docker
docker_opts ?= --rm --tty --user "$$(id -u)"
antora_cmd ?= $(docker_cmd) run $(docker_opts) --volume "$${PWD}":/antora ghcr.io/vshn/antora:3.0.0
antora_opts ?= --cache-dir=.cache/antora
preview_cmd ?= $(docker_cmd) run --rm --publish 35729:35729 --publish 2020:2020 --volume "${PWD}":/preview/antora ghcr.io/vshn/antora-preview:3.1.2.3 --antora=docs --style=appuio
vale_cmd ?= $(docker_cmd) run $(docker_opts) --volume "$${PWD}"/docs/modules:/pages vshn/vale:2.1.1 --minAlertLevel=error /pages
UNAME := $(shell uname)
ifeq ($(UNAME), Linux)
OS = linux-x64
OPEN = xdg-open
endif
ifeq ($(UNAME), Darwin)
OS = darwin-x64
OPEN = open
endif
.PHONY: all
all: html open
.PHONY: clean
clean:
rm -rf $(out_dir) $(web_dir) .cache
.PHONY: open
open: $(web_dir)/index.html
-$(OPEN) $<
.PHONY: html
html: $(web_dir)/index.html
$(web_dir)/index.html: playbook.yml $(pages)
$(antora_cmd) $(antora_opts) $<
.PHONY: check
check:
$(vale_cmd)
.PHONY: preview
preview:
$(preview_cmd)