-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
85 lines (70 loc) · 2.99 KB
/
Makefile
File metadata and controls
85 lines (70 loc) · 2.99 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# This is the makefile for the Paylogic developer portal. It's based on the
# makefile generated by the command `pelican-quickstart' installed by Pelican,
# a static site generator written in Python. Everything we don't need has been
# removed, to keep things as simple as possible (e.g. support for publishing
# with FTP, SSH, rsync, Dropbox and S3).
PY=python
PELICAN=$(CURDIR)/.env/bin/pelican
PELICANOPTS=
BASEDIR=$(CURDIR)
INPUTDIR=$(BASEDIR)/content
OUTPUTDIR=$(BASEDIR)/output
CONFFILE=$(BASEDIR)/pelicanconf.py
PUBLISHCONF=$(BASEDIR)/publishconf.py
PATH := $(BASEDIR)/.env/bin:$(PATH)
DEVSERVER_PORT=8000
# Don't change this or the date formatting in Pelican will depend on the user's local setup...
LC_TIME = en_US.UTF-8
help:
@echo 'Makefile for the Paylogic developer portal'
@echo ''
@echo ' Usage:'
@echo ''
@echo ' make html (re)generate the web site'
@echo ' make clean remove the generated files'
@echo ' make regenerate regenerate files upon modification'
@echo ' make publish generate using production settings'
@echo ' make serve serve site at http://localhost:8000'
@echo ' make devserver start/restart develop_server.sh'
@echo ' make stopserver stop local server'
@echo ' make github upload the web site via gh-pages'
@echo ''
html: .env
$(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
clean:
[ ! -d $(OUTPUTDIR) ] || find $(OUTPUTDIR) -mindepth 1 -delete
rm -rf .env
regenerate: clean .env
$(PELICAN) -r $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
serve: .env
cd $(OUTPUTDIR) && $(PY) -m pelican.server
devserver: .env
-make stopserver
$(BASEDIR)/develop_server.sh restart $(DEVSERVER_PORT)
stopserver:
$(BASEDIR)/develop_server.sh stop $(DEVSERVER_PORT)
@echo 'Stopped Pelican and SimpleHTTPServer processes running in background.'
publish: .env
$(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(PUBLISHCONF) $(PELICANOPTS)
github: publish
# GitHub pages requires /404.html at the root of the directory structure and
# for some reason adding a /404.rst document confuses Pelican. So instead we
# put the 404 page in the /pages/ directory as a hidden page, and copy the
# generated HTML to /404.html so that the error page actually works :-).
cp $(OUTPUTDIR)/pages/page-not-found.html $(OUTPUTDIR)/404.html
# To use a custom DNS name with GitHub Pages there needs to be a /CNAME file
# in the 'gh-pages' branch containing the DNS name to be used for the site.
echo developer.paylogic.com > $(OUTPUTDIR)/CNAME
# Import the generated static files to the 'gh-pages' branch.
$(CURDIR)/.env/bin/ghp-import $(OUTPUTDIR)
ifeq ($(TRAVIS_PULL_REQUEST), false)
# Push to github
@git push -fq https://${GH_TOKEN}@github.com/$(TRAVIS_REPO_SLUG).git gh-pages > /dev/null 2>&1
endif
.env:
git submodule init
git submodule update
-rm -f .env/bin/python*
virtualenv .env -p python2.7
.env/bin/pip install -r requirements.txt
.PHONY: html help clean regenerate serve devserver publish github .env