-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
29 lines (22 loc) · 1.45 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
.PHONY: html pdf
.DEFAULT_GOAL := help
MKD := uptane-deployment-considerations-release.md
HTML := uptane-deployment-considerations-release.html
PDF := uptane-deployment-considerations-release.pdf
VER := $(shell git rev-parse --short HEAD)
DATE := $(shell git show -s --format=%cs)
# Sets release version to a simple tag if the current commit is
# tagged, otherwise gives the current commit's id and date. Will
# be overwritten if RELEASE_VERSION is set in the shell env.
# RELEASE_VERSION will appear in the document title.
RELEASE_VERSION ?= $(shell git describe --tags --exact-match 2>/dev/null || echo $(DATE)-DRAFT-$(VER))
clean: ## Remove the generated files
@rm -rf $(HTML) $(PDF) .refcache/
help: ## Print this message and exit
@echo "\033[1;37mRequires Docker\033[0m"
@awk 'BEGIN {FS = ":.*?## "} /^[0-9a-zA-Z_-]+:.*?## / {printf "\033[36m%s\033[0m : %s\n", $$1, $$2}' $(MAKEFILE_LIST) \
| column -s ':' -t
html: ## Create an HTML version of the deployment considerations, using docker
@docker run --rm -it -v $(PWD):/data uptane/pandoc $(MKD) --toc --filter pandoc-include --metadata=title:"Uptane Deployment Best Practices v.$(RELEASE_VERSION)" --number-sections -o $(HTML) --self-contained
pdf: ## Create a PDF version of the deployment considerations, using docker
@docker run --rm -it -v $(PWD):/data uptane/pandoc $(MKD) --toc --filter pandoc-include --metadata=title:"Uptane Deployment Best Practices v.$(RELEASE_VERSION)" --number-sections -o $(PDF)