summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile127
1 files changed, 122 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 1522d19..d3a2532 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,124 @@
1PY?=python
2PELICAN?=pelican
3PELICANOPTS=
1 4
5BASEDIR=$(CURDIR)
6INPUTDIR=$(BASEDIR)/content
7OUTPUTDIR=$(BASEDIR)/output
8CONFFILE=$(BASEDIR)/pelicanconf.py
9PUBLISHCONF=$(BASEDIR)/publishconf.py
2 10
3deploy: 11FTP_HOST=localhost
4 ssh julius@knut.vpn.mittenzwei.com mkdir -p help.ccc.de 12FTP_USER=anonymous
5 scp index.html julius@knut.vpn.mittenzwei.com:help.ccc.de 13FTP_TARGET_DIR=/
6 #ssh julius@content.events.ccc.de mkdir -p help.ccc.de 14
7 #scp index.html julius@content.events.ccc.de:help.ccc.de 15SSH_HOST=localhost
16SSH_PORT=22
17SSH_USER=root
18SSH_TARGET_DIR=/var/www
19
20S3_BUCKET=my_s3_bucket
21
22CLOUDFILES_USERNAME=my_rackspace_username
23CLOUDFILES_API_KEY=my_rackspace_api_key
24CLOUDFILES_CONTAINER=my_cloudfiles_container
25
26DROPBOX_DIR=~/Dropbox/Public/
27
28GITHUB_PAGES_BRANCH=gh-pages
29
30DEBUG ?= 0
31ifeq ($(DEBUG), 1)
32 PELICANOPTS += -D
33endif
34
35RELATIVE ?= 0
36ifeq ($(RELATIVE), 1)
37 PELICANOPTS += --relative-urls
38endif
39
40help:
41 @echo 'Makefile for a pelican Web site '
42 @echo ' '
43 @echo 'Usage: '
44 @echo ' make html (re)generate the web site '
45 @echo ' make clean remove the generated files '
46 @echo ' make regenerate regenerate files upon modification '
47 @echo ' make publish generate using production settings '
48 @echo ' make serve [PORT=8000] serve site at http://localhost:8000'
49 @echo ' make serve-global [SERVER=0.0.0.0] serve (as root) to $(SERVER):80 '
50 @echo ' make devserver [PORT=8000] start/restart develop_server.sh '
51 @echo ' make stopserver stop local server '
52 @echo ' make ssh_upload upload the web site via SSH '
53 @echo ' make rsync_upload upload the web site via rsync+ssh '
54 @echo ' make dropbox_upload upload the web site via Dropbox '
55 @echo ' make ftp_upload upload the web site via FTP '
56 @echo ' make s3_upload upload the web site via S3 '
57 @echo ' make cf_upload upload the web site via Cloud Files'
58 @echo ' make github upload the web site via gh-pages '
59 @echo ' '
60 @echo 'Set the DEBUG variable to 1 to enable debugging, e.g. make DEBUG=1 html '
61 @echo 'Set the RELATIVE variable to 1 to enable relative urls '
62 @echo ' '
63
64html:
65 $(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
66
67clean:
68 [ ! -d $(OUTPUTDIR) ] || rm -rf $(OUTPUTDIR)
69
70regenerate:
71 $(PELICAN) -r $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
72
73serve:
74ifdef PORT
75 cd $(OUTPUTDIR) && $(PY) -m pelican.server $(PORT)
76else
77 cd $(OUTPUTDIR) && $(PY) -m pelican.server
78endif
79
80serve-global:
81ifdef SERVER
82 cd $(OUTPUTDIR) && $(PY) -m pelican.server 80 $(SERVER)
83else
84 cd $(OUTPUTDIR) && $(PY) -m pelican.server 80 0.0.0.0
85endif
86
87
88devserver:
89ifdef PORT
90 $(BASEDIR)/develop_server.sh restart $(PORT)
91else
92 $(BASEDIR)/develop_server.sh restart
93endif
94
95stopserver:
96 $(BASEDIR)/develop_server.sh stop
97 @echo 'Stopped Pelican and SimpleHTTPServer processes running in background.'
98
99publish:
100 $(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(PUBLISHCONF) $(PELICANOPTS)
101
102ssh_upload: publish
103 scp -P $(SSH_PORT) -r $(OUTPUTDIR)/* $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR)
104
105rsync_upload: publish
106 rsync -e "ssh -p $(SSH_PORT)" -P -rvzc --delete $(OUTPUTDIR)/ $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) --cvs-exclude
107
108dropbox_upload: publish
109 cp -r $(OUTPUTDIR)/* $(DROPBOX_DIR)
110
111ftp_upload: publish
112 lftp ftp://$(FTP_USER)@$(FTP_HOST) -e "mirror -R $(OUTPUTDIR) $(FTP_TARGET_DIR) ; quit"
113
114s3_upload: publish
115 s3cmd sync $(OUTPUTDIR)/ s3://$(S3_BUCKET) --acl-public --delete-removed --guess-mime-type
116
117cf_upload: publish
118 cd $(OUTPUTDIR) && swift -v -A https://auth.api.rackspacecloud.com/v1.0 -U $(CLOUDFILES_USERNAME) -K $(CLOUDFILES_API_KEY) upload -c $(CLOUDFILES_CONTAINER) .
119
120github: publish
121 ghp-import -m "Generate Pelican site" -b $(GITHUB_PAGES_BRANCH) $(OUTPUTDIR)
122 git push origin $(GITHUB_PAGES_BRANCH)
123
124.PHONY: html help clean regenerate serve serve-global devserver publish ssh_upload rsync_upload dropbox_upload ftp_upload s3_upload cf_upload github