summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorSebastian Krzyszkowiak <dos@dosowisko.net>2014-06-15 21:42:42 +0200
committerSebastian Krzyszkowiak <dos@dosowisko.net>2014-06-15 21:42:42 +0200
commit9c8be3c54ff28ee3201366e8afcd9ee3fca865ed (patch)
treea5320d8a663efe33d48ff223028668e6b7792805 /Makefile
parentee7b9ac7d46fcdd62bd73f2f09465743923031bc (diff)
downloadwww-9c8be3c54ff28ee3201366e8afcd9ee3fca865ed.tar.gz
www-9c8be3c54ff28ee3201366e8afcd9ee3fca865ed.tar.bz2
www-9c8be3c54ff28ee3201366e8afcd9ee3fca865ed.zip
switch to pelican
Signed-off-by: Sebastian Krzyszkowiak <dos@dosowisko.net>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile61
1 files changed, 61 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..5213e55
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,61 @@
+PY=python
+PELICAN=pelican
+PELICANOPTS=
+
+BASEDIR=$(CURDIR)
+INPUTDIR=$(BASEDIR)/content
+OUTPUTDIR=$(BASEDIR)/output
+CONFFILE=$(BASEDIR)/pelicanconf.py
+PUBLISHCONF=$(BASEDIR)/publishconf.py
+
+SSH_HOST=neo900.org
+SSH_PORT=22022
+SSH_USER=dos1
+SSH_TARGET_DIR=/srv/www/htdocs
+
+DEBUG ?= 0
+ifeq ($(DEBUG), 1)
+ PELICANOPTS += -D
+endif
+
+help:
+ @echo 'Makefile for a pelican Web site '
+ @echo ' '
+ @echo 'Usage: '
+ @echo ' make clean remove the generated files '
+ @echo ' make html (re)generate the web site '
+ @echo ' make start [PORT=8000] start/restart develop_server.sh '
+ @echo ' make stop stop local server '
+ @echo ' make build generate using production settings '
+ @echo ' make upload upload the web site via rsync+ssh '
+ @echo ' '
+ @echo 'Set the DEBUG variable to 1 to enable debugging, e.g. make DEBUG=1 html'
+ @echo ' '
+
+html:
+ $(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
+
+clean:
+ [ ! -d $(OUTPUTDIR) ] || rm -rf $(OUTPUTDIR)
+
+start:
+ifdef PORT
+ $(BASEDIR)/develop_server.sh restart $(PORT)
+else
+ $(BASEDIR)/develop_server.sh restart
+endif
+
+stop:
+ $(BASEDIR)/develop_server.sh stop
+
+build:
+ $(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(PUBLISHCONF) $(PELICANOPTS)
+
+upload: build
+ ln -s /srv/hidden $(OUTPUTDIR)/hidden
+ ln -s /srv/stuff $(OUTPUTDIR)/stuff
+ ln -s /srv/photos $(OUTPUTDIR)/photos
+ cp $(BASEDIR)/mysql_connect.inc.php $(OUTPUTDIR)/
+ rsync -e "ssh -p $(SSH_PORT)" -P -rvz -l --delete $(OUTPUTDIR)/ $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) --cvs-exclude
+
+.PHONY: html help clean start stop build upload