-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (41 loc) · 1.27 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
41
42
43
44
45
46
47
48
49
50
51
PY=python
VENV=virtualenv2
FLASK_MANAGER=engine.py
BASEDIR=$(CURDIR)
OUTPUTDIR=$(BASEDIR)/build
SSH_HOST=ssl-offloader.max-k.org
SSH_PORT=443
SSH_USER=www-data
SSH_TARGET_DIR=/srv/http/blog
help:
@echo 'Makefile for Flask FlatPages/Frozen static blog'
@echo ''
@echo 'Usage :'
@echo 'make dev (re)generate static webpages using dev env'
@echo 'make prod (re)generate static webpages using prod env'
@echo 'make test open development html files in xombrero'
@echo 'make push push production html files using rsync'
@echo 'make environment deploy development environment'
serve:
. env/bin/activate; \
$(PY) $(FLASK_MANAGER) serve; \
deactivate
dev:
. env/bin/activate; \
$(PY) $(FLASK_MANAGER) build; \
deactivate
prod:
. env/bin/activate; \
FLASK_MODE='production' $(PY) $(FLASK_MANAGER) build; \
deactivate
test: dev
xombrero $(OUTPUTDIR)/index.html
push: prod
rsync -e "ssh -p $(SSH_PORT)" -P -rvz --delete \
$(OUTPUTDIR)/ $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) --cvs-exclude
virtualenv:
$(VENV) --no-site-package $(BASEDIR)/env
del-environment:
rm -rf $(BASEDIR)/env
environment: del-environment virtualenv
. env/bin/activate; pip install -Ur requirements.txt; deactivate