Skip to content

Commit b7763e9

Browse files
authored
Merge pull request #437 from projectsyn/feat/component-template/compile-cmd
component-template: Split `COMMODORE_CMD` and `COMPILE_CMD` in Makefile
2 parents 7c87113 + 86a4a05 commit b7763e9

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

commodore/component-template/{{ cookiecutter.slug }}/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ docs-serve: ## Preview the documentation
4343
.PHONY: compile
4444
.compile:
4545
mkdir -p dependencies
46-
$(COMMODORE_CMD)
46+
$(COMPILE_CMD)
4747

4848
.PHONY: test
4949
test: commodore_args += -f tests/$(instance).yml

commodore/component-template/{{ cookiecutter.slug }}/Makefile.vars.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ VALE_ARGS ?= --minAlertLevel=error --config=/pages/ROOT/pages/.vale.ini /pages
3131
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
3232

3333

34-
COMMODORE_CMD ?= $(DOCKER_CMD) $(DOCKER_ARGS) $(root_volume) docker.io/projectsyn/commodore:latest component compile . $(commodore_args)
34+
COMMODORE_CMD ?= $(DOCKER_CMD) $(DOCKER_ARGS) $(root_volume) docker.io/projectsyn/commodore:latest
35+
COMPILE_CMD ?= $(COMMODORE_CMD) component compile . $(commodore_args)
3536
JB_CMD ?= $(DOCKER_CMD) $(DOCKER_ARGS) --entrypoint /usr/local/bin/jb docker.io/projectsyn/commodore:latest install
3637

3738
instance ?= defaults

tests/test_component_template.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,9 +320,14 @@ def test_check_golden_diff(tmp_path: P):
320320
)
321321
assert exit_status == 0
322322

323-
# Call `make lint` in component directory
323+
# Override component Makefile COMMODORE_CMD to use the local Commodore binary
324+
env = os.environ
325+
env["COMMODORE_CMD"] = "commodore"
326+
327+
# Call `make golden-diff` in component directory
324328
exit_status = call(
325329
"make golden-diff",
330+
env=env,
326331
shell=True,
327332
cwd=tmp_path / "dependencies" / component_name,
328333
)

0 commit comments

Comments
 (0)