From b22793f57e6adc2a5537ee7cb06d936800848660 Mon Sep 17 00:00:00 2001 From: Ced Date: Fri, 27 Oct 2023 21:05:21 +0100 Subject: [PATCH 1/6] Simplify verify target Little value in building the sans-serif pdf... can only fails if a font is missing. --- makefile | 41 +++++++++++++++++------------------------ 1 file changed, 17 insertions(+), 24 deletions(-) diff --git a/makefile b/makefile index a52e6e3..b67496a 100644 --- a/makefile +++ b/makefile @@ -1,45 +1,38 @@ DOCKER_IMAGE := ghcr.io/hendricius/the-sourdough-framework +DOCKER_CMD := docker run -it -v $(PWD):/opt/repo $(DOCKER_IMAGE) /bin/bash -c -.PHONY: build_pdf -build_pdf: mrproper - docker run -it -v $(PWD):/opt/repo $(DOCKER_IMAGE) /bin/bash -c "cd /opt/repo/book && make" +.PHONY: bake build_pdf build_docker_image push_docker_image validate website +.PHONY: print_os_version start_shell printvars show_tools_version mrproper -.PHONY: bake -bake: mrproper - docker run -it -v $(PWD):/opt/repo $(DOCKER_IMAGE) /bin/bash -c "cd /opt/repo/book && make bake" +build_pdf: + "cd /opt/repo/book && make" + +bake: + $(DOCKER_CMD) "cd /opt/repo/book && make bake" -.PHONY: build_docker_image build_docker_image: docker build -t $(DOCKER_IMAGE) -f Dockerfile --progress=plain . -.PHONY: push_docker_image -push_docker_image: +push_docker_image: build_docker_image docker push $(DOCKER_IMAGE):latest -.PHONY: website -website: mrproper - docker run -it -v $(PWD):/opt/repo $(DOCKER_IMAGE) /bin/bash -c "cd /opt/repo/book && make website" +website: + $(DOCKER_CMD) "cd /opt/repo/book && make website" -.PHONY: validate -validate: mrproper - docker run -it -v $(PWD):/opt/repo $(DOCKER_IMAGE) /bin/bash -c "cd /opt/repo/book && make -j build_pdf build_ebook" +validate: + $(DOCKER_CMD) "cd /opt/repo/book && make -j build_serif_pdf build_ebook" -.PHONY: mrproper mrproper: - docker run -it -v $(PWD):/opt/repo $(DOCKER_IMAGE) /bin/bash -c "cd /opt/repo/book && make mrproper" + $(DOCKER_CMD) "cd /opt/repo/book && make mrproper" -.PHONY: show_tools_version show_tools_version: - docker run -it -v $(PWD):/opt/repo $(DOCKER_IMAGE) /bin/bash -c "cd /opt/repo/book && make show_tools_version" + $(DOCKER_CMD) "cd /opt/repo/book && make show_tools_version" -.PHONY: printvars printvars: - docker run -it -v $(PWD):/opt/repo $(DOCKER_IMAGE) /bin/bash -c "cd /opt/repo/book && make printvars" + $(DOCKER_CMD) "cd /opt/repo/book && make printvars" -.PHONY: print_os_version print_os_version: - docker run -it -v $(PWD):/opt/repo $(DOCKER_IMAGE) /bin/bash -c "cat /etc/*release" + $(DOCKER_CMD) "cat /etc/*release" -.PHONY: start_shell start_shell: docker run -it -v $(PWD):/opt/repo $(DOCKER_IMAGE) /bin/bash From 9adcca73ebe839c6185b95fb986286d53bd9c2cf Mon Sep 17 00:00:00 2001 From: Ced Date: Fri, 27 Oct 2023 21:14:50 +0100 Subject: [PATCH 2/6] Remove unused targets in main makefile Reorder logically and comment --- makefile | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/makefile b/makefile index b67496a..6badc0e 100644 --- a/makefile +++ b/makefile @@ -2,29 +2,28 @@ DOCKER_IMAGE := ghcr.io/hendricius/the-sourdough-framework DOCKER_CMD := docker run -it -v $(PWD):/opt/repo $(DOCKER_IMAGE) /bin/bash -c .PHONY: bake build_pdf build_docker_image push_docker_image validate website -.PHONY: print_os_version start_shell printvars show_tools_version mrproper - -build_pdf: - "cd /opt/repo/book && make" - -bake: - $(DOCKER_CMD) "cd /opt/repo/book && make bake" +.PHONY: print_os_version start_shell printvars show_tools_version +# Dockers targets build_docker_image: docker build -t $(DOCKER_IMAGE) -f Dockerfile --progress=plain . push_docker_image: build_docker_image docker push $(DOCKER_IMAGE):latest -website: - $(DOCKER_CMD) "cd /opt/repo/book && make website" +# Books/website +# Quicker run for each commit, shall catch most problems validate: $(DOCKER_CMD) "cd /opt/repo/book && make -j build_serif_pdf build_ebook" -mrproper: - $(DOCKER_CMD) "cd /opt/repo/book && make mrproper" +bake: + $(DOCKER_CMD) "cd /opt/repo/book && make bake" +website: + $(DOCKER_CMD) "cd /opt/repo/book && make website" + +# Debug helpers show_tools_version: $(DOCKER_CMD) "cd /opt/repo/book && make show_tools_version" From a8e98595c7d29ec1fa04178658621d14180d5837 Mon Sep 17 00:00:00 2001 From: Ced Date: Fri, 27 Oct 2023 21:16:22 +0100 Subject: [PATCH 3/6] Use parallel build on github release action --- .github/workflows/release-book.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-book.yml b/.github/workflows/release-book.yml index f10092b..65738ea 100644 --- a/.github/workflows/release-book.yml +++ b/.github/workflows/release-book.yml @@ -32,7 +32,7 @@ jobs: options: -v ${{ github.workspace }}:/app run: | cd /app/book - make bake + make -j bake - name: Release baked book to S3 uses: shallwefootball/s3-upload-action@master with: From 500f5e7dce2c7ef65517cbdccf2506e45b90d41b Mon Sep 17 00:00:00 2001 From: Ced Date: Fri, 27 Oct 2023 21:17:51 +0100 Subject: [PATCH 4/6] Limit validate CI to serif pdf target and ebook --- .github/workflows/validate-book-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate-book-build.yml b/.github/workflows/validate-book-build.yml index 35aafa5..adf48e2 100644 --- a/.github/workflows/validate-book-build.yml +++ b/.github/workflows/validate-book-build.yml @@ -29,4 +29,4 @@ jobs: options: -v ${{ github.workspace }}:/app run: | cd /app/book - make -j build_pdf build_ebook + make -j build_serif_pdf build_ebook From 8ab6cad1fb0ac0f224193da34061e50a73da7a39 Mon Sep 17 00:00:00 2001 From: Ced Date: Fri, 27 Oct 2023 21:44:35 +0100 Subject: [PATCH 5/6] Add some targets back in docker makefile I now understand how they can be useful... --- makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/makefile b/makefile index 6badc0e..8691e4b 100644 --- a/makefile +++ b/makefile @@ -2,7 +2,7 @@ DOCKER_IMAGE := ghcr.io/hendricius/the-sourdough-framework DOCKER_CMD := docker run -it -v $(PWD):/opt/repo $(DOCKER_IMAGE) /bin/bash -c .PHONY: bake build_pdf build_docker_image push_docker_image validate website -.PHONY: print_os_version start_shell printvars show_tools_version +.PHONY: print_os_version start_shell printvars show_tools_version mrproper # Dockers targets build_docker_image: @@ -17,12 +17,18 @@ push_docker_image: build_docker_image validate: $(DOCKER_CMD) "cd /opt/repo/book && make -j build_serif_pdf build_ebook" +build_pdf: + $(DOCKER_CMD) "cd /opt/repo/book && make" + bake: - $(DOCKER_CMD) "cd /opt/repo/book && make bake" + $(DOCKER_CMD) "cd /opt/repo/book && make -j bake" website: $(DOCKER_CMD) "cd /opt/repo/book && make website" +mrproper: + $(DOCKER_CMD) "cd /opt/repo/book && make mrproper" + # Debug helpers show_tools_version: $(DOCKER_CMD) "cd /opt/repo/book && make show_tools_version" From 9d76ea1cf9fc520293621460e09032628902a346 Mon Sep 17 00:00:00 2001 From: Hendrik Kleinwaechter Date: Mon, 30 Oct 2023 23:41:04 +1300 Subject: [PATCH 6/6] Add default target --- makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/makefile b/makefile index 8691e4b..2756c5b 100644 --- a/makefile +++ b/makefile @@ -1,3 +1,5 @@ +.DEFAULT_GOAL := build_pdf + DOCKER_IMAGE := ghcr.io/hendricius/the-sourdough-framework DOCKER_CMD := docker run -it -v $(PWD):/opt/repo $(DOCKER_IMAGE) /bin/bash -c