From af9301720443b34ad5ca66e57eb8745a985fdfdc Mon Sep 17 00:00:00 2001 From: Emil Miler Date: Sat, 1 Jun 2024 11:53:13 +0200 Subject: [PATCH] Use Docker to invoke ChordPro 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. --- makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/makefile b/makefile index 4258e48..cf2117e 100644 --- a/makefile +++ b/makefile @@ -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)