From 3cea2ba18d6cf8477af266f37975c25e0be37c8e Mon Sep 17 00:00:00 2001 From: "Glenn Y. Rolland" Date: Mon, 23 Sep 2024 01:03:10 +0200 Subject: [PATCH] refactor: makefile & tasks --- Makefile | 14 ++++---------- docker/entrypoint.sh | 2 +- tasks/docker.mk | 1 + tasks/docs.mk | 10 ++++++++++ tasks/shell.mk | 9 +++++++++ tasks/slides.mk | 9 +++++++++ 6 files changed, 34 insertions(+), 11 deletions(-) create mode 100644 tasks/shell.mk diff --git a/Makefile b/Makefile index dcb8044..9a16e22 100755 --- a/Makefile +++ b/Makefile @@ -111,11 +111,8 @@ watch: ## run development server pipenv run honcho start serve: watch -serve-docs: watch-docs .PHONY: watch serve -.PHONY: watch-docs serve-docs -.PHONY: watch-docs-internal ## ## Build final documents @@ -126,13 +123,9 @@ serve-docs: watch-docs build: build-pdf build-html ## build all documents as PDF and HTML files -build-pptx: build-slides-pptx ## build slides as PPTX files - -build-pdf: build-docs-pdf build-slides-pdf ## build both docs and slides as PDF files - -build-html: build-docs-html build-slides-html ## build both docs and slides as HTML files - -build-docs: build-docs-pdf build-docs-html ## build only docs as PDF and HTML +build-pptx: ## build both docs and slides as PPTX files +build-html: ## build both docs and slides as HTML files +build-pdf: ## build both docs and slides as PDF files .PHONY: build @@ -162,4 +155,5 @@ include tasks/slides.mk include tasks/docker.mk include tasks/utils.mk include tasks/images.mk +include tasks/shell.mk diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 0c3d4c8..175ab88 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -44,7 +44,7 @@ else fi # set +x -if [ "$1" = "shell" ]; then +if [ "$1" = "supershell" ]; then exec bash else exec gosu "$EXT_UID:$EXT_GID" make "$@" diff --git a/tasks/docker.mk b/tasks/docker.mk index 06472d0..a7b899e 100644 --- a/tasks/docker.mk +++ b/tasks/docker.mk @@ -4,6 +4,7 @@ docker-build: ## build docker image docker build \ --file docker/Dockerfile \ --tag glenux/docmachine:$(BUILD_VERSION) \ + --output type=docker \ . docker tag \ glenux/docmachine:$(BUILD_VERSION) \ diff --git a/tasks/docs.mk b/tasks/docs.mk index 40eb661..8a6e235 100644 --- a/tasks/docs.mk +++ b/tasks/docs.mk @@ -58,3 +58,13 @@ watch-docs: ## run development server for static docs site .PHONY: watch-docs watch: watch-docs + +build-pdf: build-docs-pdf ## build docs as PDF files +build-html: build-docs-html ## build docs as HTML files +build-docs: build-docs-pdf build-docs-html ## build only docs as PDF and HTML + +serve-docs: watch-docs + +.PHONY: watch-docs serve-docs +.PHONY: watch-docs-internal + diff --git a/tasks/shell.mk b/tasks/shell.mk new file mode 100644 index 0000000..8e297c7 --- /dev/null +++ b/tasks/shell.mk @@ -0,0 +1,9 @@ + +.PHONY: supershell +supershell: shell + +.PHONY: shell +shell: + @echo "Running shell..." + @bash + diff --git a/tasks/slides.mk b/tasks/slides.mk index c0c4aec..871e5b1 100644 --- a/tasks/slides.mk +++ b/tasks/slides.mk @@ -104,3 +104,12 @@ watch-tocupdate-internal: $(MAKE) images ; \ done +.PHONY: build-slides-pdf +build-pdf: build-slides-pdf ## build slides as PDF files + +.PHONY: build-slides-html +build-html: build-slides-html ## build slides as HTML files + +.PHONY: build-slides-pptx +build-pptx: build-slides-pptx ## build slides as PPTX files +