4
4
# Additional Makefiles can be added to `.sync.yml` in 'Makefile.includes'
5
5
#
6
6
7
- # Commodore takes the root dir name as the component name
8
- COMPONENT_NAME ?= $( shell basename ${PWD} | sed s/component-//)
7
+ # The component name is hard-coded from the template
8
+ COMPONENT_NAME ?= vcluster
9
9
10
+ git_dir ?= $(shell git rev-parse --git-common-dir)
10
11
compiled_path ?= compiled/$(COMPONENT_NAME ) /$(COMPONENT_NAME )
11
12
root_volume ?= -v "$${PWD}:/$(COMPONENT_NAME ) "
12
13
compiled_volume ?= -v "$${PWD}/$(compiled_path ) :/$(COMPONENT_NAME ) "
13
- commodore_args ?= --search-paths ./dependencies --search-paths .
14
+ commodore_args ?= --search-paths ./dependencies --search-paths . -n $(COMPONENT_NAME )
15
+
16
+ ifneq "$(git_dir ) " ".git"
17
+ git_volume ?= -v "$(git_dir):$(git_dir):ro"
18
+ antora_git_volume ?= -v "$(git_dir):/preview/antora/.git:ro"
19
+ else
20
+ git_volume ?=
21
+ antora_git_volume ?= -v "${PWD}/.git:/preview/antora/.git:ro"
22
+ endif
14
23
15
24
ifneq "$(shell which docker 2>/dev/null) " ""
16
25
DOCKER_CMD ?= $(shell which docker)
@@ -34,9 +43,9 @@ YAMLLINT_DOCKER ?= $(DOCKER_CMD) $(DOCKER_ARGS) $(root_volume) $(YAMLLINT_IMAGE)
34
43
VALE_CMD ?= $(DOCKER_CMD ) $(DOCKER_ARGS ) $(root_volume ) --volume "$${PWD}"/docs/modules:/pages docker.io/vshn/vale:2.1.1
35
44
VALE_ARGS ?= --minAlertLevel=error --config=/pages/ROOT/pages/.vale.ini /pages
36
45
37
- ANTORA_PREVIEW_CMD ?= $(DOCKER_CMD ) run --rm --publish 35729:35729 --publish 2020:2020 --volume "${PWD}/.git":/preview/antora/.git --volume "${PWD}/docs":/preview/antora/docs docker.io/vshn/antora-preview:3.0.1.1 --style=syn --antora=docs
46
+ ANTORA_PREVIEW_CMD ?= $(DOCKER_CMD ) run --rm --publish 35729:35729 --publish 2020:2020 $( antora_git_volume ) --volume "${PWD}/docs":/preview/antora/docs docker.io/vshn/antora-preview:3.0.1.1 --style=syn --antora=docs
38
47
39
- COMMODORE_CMD ?= $(DOCKER_CMD ) $(DOCKER_ARGS ) $(root_volume ) docker.io/projectsyn/commodore:latest
48
+ COMMODORE_CMD ?= $(DOCKER_CMD ) $(DOCKER_ARGS ) $(git_volume ) $( root_volume ) docker.io/projectsyn/commodore:latest
40
49
COMPILE_CMD ?= $(COMMODORE_CMD ) component compile . $(commodore_args )
41
50
JB_CMD ?= $(DOCKER_CMD ) $(DOCKER_ARGS ) --entrypoint /usr/local/bin/jb docker.io/projectsyn/commodore:latest install
42
51
0 commit comments