Use Docker to invoke ChordPro
Some checks failed
Build / build (push) Failing after 2s

This allows us to run Make in a predictable environemnt without having
to install all the perl dependencies. It should work both locally
and during build in the pipeline.
This commit is contained in:
Emil Miler 2024-06-01 11:53:13 +02:00
parent 26ada96c25
commit af93017204

View File

@ -1,3 +1,9 @@
ifdef CHORDPRO_PIPELINE
CHORDPRO_CMD = chordpro
else
CHORDPRO_CMD = docker run -ti --rm --env HOME=$(HOME) --env USER=$(USER) --workdir $(shell pwd) --volume $(HOME):$(HOME) chordpro/chordpro:latest chordpro --config=chordpro.json
endif
SRC_DIR := $(wildcard content/*)
SRC_EXTENSION := .cho
@ -9,10 +15,10 @@ SONGBOOK := songbook.pdf
.DEFAULT_GOAL := all
%.pdf: %$(SRC_EXTENSION)
chordpro --config=chordpro.json -o $@ $<
$(CHORDPRO_CMD) -o $@ $<
%.html: %$(SRC_EXTENSION)
chordpro --config=chordpro.json -o $@ $<
$(CHORDPRO_CMD) -o $@ $<
all: $(SONG_PDF) $(SONG_HTML) $(SONGBOOK)