-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (30 loc) · 1.07 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
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/make -f
# -*- makefile -*-
SRCES := $(glob 20*/*/*/*.rst)
POST :=
PAGE :=
VENV_DIR := .venv
all: build ## execute all build tasks.
prebuild: ## prepare tinkerer venv.
test -d .venv || python -m venv $(VENV_DIR)
$(VENV_DIR)/bin/python -m pip install -r requirements.txt
build: prebuild $(SRCES) ## build blog articles.
. $(VENV_DIR)/bin/activate; \
tinker -b -q; \
deactivate
post: ## create a new post with the title `POST`.
. $(VENV_DIR)/bin/activate; \
tinker -p '$(POST)'; \
deactivate
page: ## create a new page with the title `PAGE`.
. $(VENV_DIR)/bin/activate; \
tinker --page '$(PAGE)'; \
deactivate
publish: ## publish to blog server with rsync.
rsync -a --exclude 'glaneuses.json' --delete blog/html/ blogadm@web:/var/www/d.palmtb.net/
staging: ## copy to local http document root with rsync.
rsync -a --exclude 'glaneuses.json' --delete blog/html/ /var/www/html/
help:
@grep -h -P '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS=":.*?## "};{printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: help
#.DEFAULT_GOAL := help