Skip to content

Commit 17d1560

Browse files
authored
Merge pull request #33 from projectsyn/modulesync-f459402
[ModuleSync] Update from projectsyn/modulesync-control@f459402
2 parents 6a5712a + 23fd442 commit 17d1560

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

Makefile.vars.mk

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,22 @@
44
# Additional Makefiles can be added to `.sync.yml` in 'Makefile.includes'
55
#
66

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
99

10+
git_dir ?= $(shell git rev-parse --git-common-dir)
1011
compiled_path ?= compiled/$(COMPONENT_NAME)/$(COMPONENT_NAME)
1112
root_volume ?= -v "$${PWD}:/$(COMPONENT_NAME)"
1213
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
1423

1524
ifneq "$(shell which docker 2>/dev/null)" ""
1625
DOCKER_CMD ?= $(shell which docker)
@@ -34,9 +43,9 @@ YAMLLINT_DOCKER ?= $(DOCKER_CMD) $(DOCKER_ARGS) $(root_volume) $(YAMLLINT_IMAGE)
3443
VALE_CMD ?= $(DOCKER_CMD) $(DOCKER_ARGS) $(root_volume) --volume "$${PWD}"/docs/modules:/pages docker.io/vshn/vale:2.1.1
3544
VALE_ARGS ?= --minAlertLevel=error --config=/pages/ROOT/pages/.vale.ini /pages
3645

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
3847

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
4049
COMPILE_CMD ?= $(COMMODORE_CMD) component compile . $(commodore_args)
4150
JB_CMD ?= $(DOCKER_CMD) $(DOCKER_ARGS) --entrypoint /usr/local/bin/jb docker.io/projectsyn/commodore:latest install
4251

0 commit comments

Comments
 (0)