From 76ec3ccb49e6a08d79c0d24b2659f4a23921f9c7 Mon Sep 17 00:00:00 2001 From: Anton Livaja Date: Mon, 17 Feb 2025 01:54:47 -0500 Subject: [PATCH] modify Makefile to add commit hash to book.toml before building, then clean up afterwards --- Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 20ce22a..aadd992 100644 --- a/Makefile +++ b/Makefile @@ -1,20 +1,27 @@ PORT := 8080 +COMMIT_HASH := $(shell git log -1 --pretty=format:%H | cut -c1-10) .PHONY: default default: build-qvs out: mkdir -p out +.PHONY: clean +clean: + rm -rf out/ + .PHONY: build-qvs -build-qvs: out/qvs/index.json +build-qvs: clean out/qvs/index.json out/qvs/index.json: out Containerfile.qvs $(shell find quorum-vault-system -type f) mkdir -p out/qvs + sed -i "/^title *=/c\title = \"Quorum Vault System (QVS) ${COMMIT_HASH}\"" quorum-vault-system/book.toml docker \ build \ -f Containerfile.qvs \ --output type=oci,rewrite-timestamp=true,force-compression=true,name=git.distrust.co/public/docs-qvs,tar=true,dest=- \ . \ | tar -C out/qvs -mx + sed -i "/^title *=/c\title = \"Quorum Vault System (QVS)\"" quorum-vault-system/book.toml .PHONY: serve-qvs serve-qvs: build-qvs -- 2.40.1