forked from projectsyn/commodore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
67 lines (48 loc) · 1.47 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
MAKEFLAGS += -j4
pages := $(shell find docs -type f -name '*.adoc')
web_dir := ./_antora
docker_cmd ?= docker
docker_opts ?= --rm --tty --user "$$(id -u)"
antora_cmd ?= $(docker_cmd) run $(docker_opts) --volume "$${PWD}":/antora vshn/antora:2.3.0
antora_opts ?= --cache-dir=.cache/antora
vale_cmd ?= $(docker_cmd) run $(docker_opts) --volume "$${PWD}"/docs/modules/ROOT/pages:/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: docs
# This will clean the Antora Artifacts, not the npm artifacts
.PHONY: clean
clean:
rm -rf $(web_dir)
.PHONY: docs
docs: $(web_dir)/index.html
$(web_dir)/index.html: playbook.yml $(pages)
$(antora_cmd) $(antora_opts) $<
.PHONY: check
check:
$(vale_cmd)
###
### Section for Commodore linting and testing
###
include tox.mk
###
### Section for Commodore image build using GitHub actions
###
# Project parameters
BINARY_NAME ?= commodore
GITVERSION ?= $(shell git describe --tags --always --match=v* --dirty=+dirty || (echo "command failed $?"; exit 1))
PYVERSION ?= $(shell git describe --tags --always --abbrev=0 --match=v* || (echo "command failed $?"; exit 1))
IMAGE_NAME ?= docker.io/vshn/$(BINARY_NAME):test
.PHONY: docker
docker:
docker build --build-arg PYVERSION=$(PYVERSION) \
--build-arg GITVERSION=$(GITVERSION) \
-t $(IMAGE_NAME) .
@echo built image $(IMAGE_NAME)