-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
- Loading branch information
Showing
47 changed files
with
8,373 additions
and
13,042 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
DIST_DIR=./dist | ||
PRESENTATION_URL=http://localhost:8000 | ||
REPOSITORY_URL=file://./ | ||
CURRENT_UID=0 # Root by default | ||
BUILD_DIR=/tmp/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,47 @@ | ||
CURRENT_UID = $(shell id -u):$(shell id -g) | ||
DIST_DIR ?= $(CURDIR)/dist | ||
|
||
REPOSITORY_URL ?= https://github.com/dduportal/slides | ||
PRESENTATION_URL ?= https://dduportal.github.io/slides/main | ||
|
||
export PRESENTATION_URL CURRENT_UID REPOSITORY_URL | ||
REPOSITORY_URL ?= file://$(CURDIR) | ||
export REPOSITORY_URL DIST_DIR | ||
|
||
## Docker Buildkit is enabled for faster build and caching of images | ||
DOCKER_BUILDKIT ?= 1 | ||
COMPOSE_DOCKER_CLI_BUILD ?= 1 | ||
export DOCKER_BUILDKIT COMPOSE_DOCKER_CLI_BUILD | ||
|
||
all: clean build verify pdf | ||
## Define the reusable shell commands once for all | ||
compose_cmd = docker compose --file=$(CURDIR)/docker-compose.yml $(1) | ||
compose_up = $(call compose_cmd, up --build $(1)) | ||
compose_run = $(call compose_cmd, run --user=0 $(1)) | ||
|
||
# Generate documents inside a container, all *.adoc in parallel | ||
build: clean $(DIST_DIR) ## Generate documents | ||
@docker-compose up \ | ||
--build \ | ||
--force-recreate \ | ||
--exit-code-from build \ | ||
build | ||
all: clean build verify | ||
|
||
$(DIST_DIR): | ||
mkdir -p $(DIST_DIR) | ||
# Generate documents inside a container, all *.adoc in parallel | ||
build: | ||
@$(call compose_up,--exit-code-from=build build) | ||
|
||
verify: ## Verifies the generated HTML | ||
echo "Verification disabled" | ||
# @docker run --rm \ | ||
# -v $(DIST_DIR):/dist \ | ||
# --user $(CURRENT_UID) \ | ||
# 18fgsa/html-proofer \ | ||
# --check-html \ | ||
# --http-status-ignore "999" \ | ||
# --url-ignore "/localhost:/,/127.0.0.1:/,/$(PRESENTATION_URL)/,/github.com\/$(REPOSITORY_OWNER)\/slides\/tree/" \ | ||
# /dist/index.html | ||
verify: | ||
@echo "Verify disabled" | ||
|
||
serve: clean $(DIST_DIR) prepare qrcode ## Starts a local web server to serve the slides (localhost:8000) | ||
@docker-compose up --build --force-recreate serve | ||
serve: | ||
@$(call compose_up, --force-recreate serve qrcode) | ||
|
||
shell: $(DIST_DIR) prepare ## Starts the server and opens a shell into it | ||
@CURRENT_UID=0 docker-compose run --entrypoint=sh --rm serve | ||
shell: | ||
@$(call compose_run,--entrypoint=sh --rm serve) | ||
|
||
dependencies-lock-update: $(DIST_DIR) prepare ## Updates the npm dependencies | ||
@CURRENT_UID=0 docker-compose run --entrypoint=npm --rm serve install --package-lock | ||
dependencies-lock-update: | ||
@$(call compose_run,--entrypoint=npm --rm serve install --package-lock) | ||
|
||
dependencies-update: $(DIST_DIR) prepare ## Updates the dependencies | ||
@CURRENT_UID=0 docker-compose run --entrypoint=ncu --workdir=/app/npm-packages --rm serve -u | ||
dependencies-update: | ||
@$(call compose_run,--entrypoint=ncu --workdir=/app/npm-packages --rm serve -u) | ||
@make -C $(CURDIR) dependencies-lock-update | ||
|
||
$(DIST_DIR)/index.html: build | ||
|
||
pdf: $(DIST_DIR)/index.html ## Generate a PDF version of the slides | ||
@docker run --rm -t \ | ||
-v $(DIST_DIR):/slides \ | ||
--user $(CURRENT_UID) \ | ||
--read-only=true \ | ||
--tmpfs=/tmp \ | ||
astefanutti/decktape:3.4.1 \ | ||
/slides/index.html \ | ||
/slides/slides.pdf \ | ||
--size='2048x1536' \ | ||
--pause 0 | ||
pdf: | ||
@$(call compose_up, --exit-code-from=pdf pdf) | ||
|
||
clean: ## Clean the docker environment and the output directory | ||
@docker-compose down -v --remove-orphans | ||
clean: | ||
@$(call compose_cmd, down -v --remove-orphans) | ||
@rm -rf $(DIST_DIR) | ||
|
||
qrcode: ## Generate the QRcode | ||
@docker-compose run --entrypoint=/app/node_modules/.bin/qrcode --rm serve -t png -o /app/content/media/qrcode.png $(PRESENTATION_URL) | ||
|
||
help: ## Display this help screen | ||
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | ||
qrcode: | ||
@$(call compose_up, qrcode) | ||
|
||
.PHONY: all build verify serve qrcode pdf prepare dependencies-update dependencies-lock-update | ||
.PHONY: all build verify serve qrcode pdf dependencies-update dependencies-lock-update |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.