-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
40 lines (33 loc) · 1.27 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
pages := $(shell find . -type f -name '*.adoc')
# Determine whether to use podman
#
# podman currently fails when executing in GitHub actions on Ubuntu LTS 20.04,
# so we never use podman if GITHUB_ACTIONS==true.
use_podman := 1
ifeq ($(use_podman),0)
engine_cmd ?= podman
engine_opts ?= --rm --tty --userns=keep-id
else
engine_cmd ?= docker
engine_opts ?= --rm --tty --user "$$(id -u)"
endif
preview_cmd ?= $(engine_cmd) run --rm --publish 35729:35729 --publish 2020:2020 --volume "${PWD}":/preview/antora ghcr.io/vshn/antora-preview:3.1.4 --antora=docs --style=vshn
vale_cmd ?= $(engine_cmd) run $(engine_opts) --volume "$${PWD}"/docs/modules:/pages:Z ghcr.io/vshn/vale:2.15.5 --minAlertLevel=error --config=/pages/ROOT/pages/.vale.ini /pages
UNAME := $(shell uname)
ifeq ($(UNAME), Linux)
OS = linux-x64
OPEN = xdg-open
endif
ifeq ($(UNAME), Darwin)
OS = darwin-x64
OPEN = open
endif
.PHONY: check
check: ## Run vale agains the documentation to check writing style
$(vale_cmd)
.PHONY: preview
preview: ## Start the preview server with live reload capabilities, available under http://localhost:2020
$(preview_cmd)
.PHONY: help
help: ## Show this help
@grep -E -h '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'