/
Makefile
39 lines (33 loc) · 947 Bytes
/
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
ARGS := \
--site-title "Hey Reader!" \
--site-description "personal online journal of Alex Recker" \
--site-domain "www.alexrecker.com" \
--site-author "Alex Recker" \
--site-email "alex@reckerfamily.com"
.PHONY: all
all: lint build
.PHONY: build
build: venv/bin/python
./venv/bin/python -m src $(ARGS)
venv/bin/python: requirements/prod.txt .python-version
rm -rf ./venv
python -m venv --copies ./venv
./venv/bin/pip install --upgrade --quiet pip
./venv/bin/pip install --quiet -r requirements/prod.txt
.PHONY: clean
clean:
rm -rf ./www/*.xml
rm -rf ./www/*.txt
rm -rf ./www/*.html
rm -rf ./venv
.PHONY: lint
lint: venv/bin/python
./venv/bin/flake8 --doctests --color never --extend-exclude "venv/*" .
PUBLISH_TAG := entry-$(shell date '+%Y-%m-%d')
.PHONY: publish
publish:
git add -A
git commit -m "publish new entry: $(PUBLISH_TAG)"
git tag "$(PUBLISH_TAG)"
git push origin --tags
git push origin "master:master"