From 1ebd4cbd4fe31a2ac99bd8d20da18831b045d2a2 Mon Sep 17 00:00:00 2001 From: "Glenn Y. Rolland" Date: Mon, 5 Aug 2024 12:36:47 +0200 Subject: [PATCH] refactor(make): split Makefile into sub-tasks files --- Makefile | 33 +++++---------------------------- tasks/docker.mk | 16 ++++++++++++++++ tasks/docs.mk | 12 ++++++++++++ tasks/utils.mk | 10 ++++++++++ 4 files changed, 43 insertions(+), 28 deletions(-) create mode 100644 tasks/docker.mk create mode 100644 tasks/docs.mk create mode 100644 tasks/utils.mk diff --git a/Makefile b/Makefile index e558330..8165299 100755 --- a/Makefile +++ b/Makefile @@ -70,17 +70,13 @@ all: help ## Install prerequisites ## -prepare: prepare-slides prepare-docs ## install prerequisites +prepare: prepare-slides prepare-slides: ## install prerequisites for PDF slides only npm install npm rebuild node-sass npx browserslist@latest --update-db - -prepare-docs: ## install prerequisites for static docs site only - pipenv install - -.PHONY: prepare prepare-slides prepare-docs +.PHONY: prepare prepare-slides images: $(DOCS_IMAGES_SVG) $(DOCS_IMAGES_PNG) ## build images @echo "Source:" @@ -273,26 +269,7 @@ clean-docs: .PHONY: clean clean-slides clean-docs -## -## Utilities -## +include tasks/docs.mk +include tasks/docker.mk +include tasks/utils.mk -fixme: - @egrep --color -rni '(fixme)' $(DOCS_DIR) $(SLIDES_DIR) - -.PHONY: fixme - -docker-build: ## build docker image - docker build \ - --file docker/Dockerfile \ - --tag glenux/docmachine:$(BUILD_VERSION) \ - . - docker tag \ - glenux/docmachine:$(BUILD_VERSION) \ - glenux/docmachine:latest - -docker-push: ## push docker image - env docker push glenux/docmachine:latest - -docker-pull: ## download docker image - env docker pull glenux/docmachine:latest diff --git a/tasks/docker.mk b/tasks/docker.mk new file mode 100644 index 0000000..06472d0 --- /dev/null +++ b/tasks/docker.mk @@ -0,0 +1,16 @@ +# vim: set ft=make : + +docker-build: ## build docker image + docker build \ + --file docker/Dockerfile \ + --tag glenux/docmachine:$(BUILD_VERSION) \ + . + docker tag \ + glenux/docmachine:$(BUILD_VERSION) \ + glenux/docmachine:latest + +docker-push: ## push docker image + env docker push glenux/docmachine:latest + +docker-pull: ## download docker image + env docker pull glenux/docmachine:latest diff --git a/tasks/docs.mk b/tasks/docs.mk new file mode 100644 index 0000000..43ed290 --- /dev/null +++ b/tasks/docs.mk @@ -0,0 +1,12 @@ +# vim: set ft=make : + +prepare: prepare-docs ## install prerequisites + +prepare-docs: ## install prerequisites for static docs site only + pipenv install + +sync-docs-internal: + @>&2 echo "ERROR: not implemented" + exit 1 + +.PHONY: prepare-docs diff --git a/tasks/utils.mk b/tasks/utils.mk new file mode 100644 index 0000000..fb6db7e --- /dev/null +++ b/tasks/utils.mk @@ -0,0 +1,10 @@ +# vim: set ft=make : + +## +## Utilities +## + +fixme: + @egrep --color -rni '(fixme)' $(DOCS_DIR) $(SLIDES_DIR) + +.PHONY: fixme