This repository has been archived by the owner on Aug 6, 2024. It is now read-only.
forked from mozilla-services/servicedenuages.fr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (47 loc) · 1.49 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
52
53
54
55
56
57
58
59
60
61
PELICANOPTS=
BASEDIR=$(CURDIR)
INPUTDIR=$(BASEDIR)/content
OUTPUTDIR=$(BASEDIR)/output
CONFFILE=$(BASEDIR)/pelicanconf.py
PUBLISHCONF=$(BASEDIR)/publishconf.py
GITHUB_PAGES_BRANCH=gh-pages
VENV := $(shell echo $${VIRTUAL_ENV-$(shell pwd)/.venv})
VIRTUALENV = virtualenv --python python2.7
INSTALL_STAMP = $(VENV)/.install.stamp
PYTHON=$(VENV)/bin/python
PELICAN=$(VENV)/bin/pelican
PIP=$(VENV)/bin/pip
DEBUG ?= 0
ifeq ($(DEBUG), 1)
PELICANOPTS += -D
endif
install: $(INSTALL_STAMP)
$(INSTALL_STAMP): $(PYTHON) requirements.txt
$(VENV)/bin/pip install -r requirements.txt
touch $(INSTALL_STAMP)
virtualenv: $(PYTHON)
$(PYTHON):
$(VIRTUALENV) $(VENV)
html: install
$(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
cp self-hosting-a-hard-promess.html $(OUTPUTDIR)/en/
clean:
[ ! -d $(OUTPUTDIR) ] || rm -rf $(OUTPUTDIR)
rm -rf $(VENV)
serve: install
ifdef PORT
cd $(OUTPUTDIR) && $(PYTHON) -m pelican.server $(PORT)
else
cd $(OUTPUTDIR) && $(PYTHON) -m pelican.server 8080
endif
regenerate:
cd $(OUTPUTDIR) && $(PYTHON) -m pelican.server &
$(PELICAN) -r $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
cp self-hosting-a-hard-promess.html $(OUTPUTDIR)/en/
publish: install
$(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(PUBLISHCONF) $(PELICANOPTS)
cp self-hosting-a-hard-promess.html $(OUTPUTDIR)/en/
github: publish
$(VENV)/bin/ghp-import -b $(GITHUB_PAGES_BRANCH) $(OUTPUTDIR)
git push origin $(GITHUB_PAGES_BRANCH) --force
.PHONY: html clean serve devserver github publish