Mercurial > hg > Blog
annotate Makefile @ 5:48e0e2d8babd
proper settings for make_rsync_upload
| author | Dirk Olmes <dirk@xanthippe.ping.de> | 
|---|---|
| date | Sat, 29 Jun 2013 17:57:01 +0200 | 
| parents | 4cd9b65e10e4 | 
| children | d56669594036 | 
| rev | line source | 
|---|---|
| 
0
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
1 PY=python | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
2 PELICAN=pelican | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
3 PELICANOPTS= | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
4 | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
5 BASEDIR=$(CURDIR) | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
6 INPUTDIR=$(BASEDIR)/content | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
7 OUTPUTDIR=$(BASEDIR)/output | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
8 CONFFILE=$(BASEDIR)/pelicanconf.py | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
9 PUBLISHCONF=$(BASEDIR)/publishconf.py | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
10 | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
11 FTP_HOST=localhost | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
12 FTP_USER=anonymous | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
13 FTP_TARGET_DIR=/ | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
14 | 
| 
5
 
48e0e2d8babd
proper settings for make_rsync_upload
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents: 
0 
diff
changeset
 | 
15 SSH_HOST=xanthippe | 
| 
0
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
16 SSH_PORT=22 | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
17 SSH_USER=dirk | 
| 
5
 
48e0e2d8babd
proper settings for make_rsync_upload
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents: 
0 
diff
changeset
 | 
18 SSH_TARGET_DIR=/var/www/htdocs/blog | 
| 
0
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
19 | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
20 S3_BUCKET=my_s3_bucket | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
21 | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
22 DROPBOX_DIR=~/Dropbox/Public/ | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
23 | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
24 help: | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
25 @echo 'Makefile for a pelican Web site ' | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
26 @echo ' ' | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
27 @echo 'Usage: ' | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
28 @echo ' make html (re)generate the web site ' | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
29 @echo ' make clean remove the generated files ' | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
30 @echo ' make regenerate regenerate files upon modification ' | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
31 @echo ' make publish generate using production settings ' | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
32 @echo ' make serve serve site at http://localhost:8000' | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
33 @echo ' make devserver start/restart develop_server.sh ' | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
34 @echo ' make stopserver stop local server ' | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
35 @echo ' ssh_upload upload the web site via SSH ' | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
36 @echo ' rsync_upload upload the web site via rsync+ssh ' | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
37 @echo ' dropbox_upload upload the web site via Dropbox ' | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
38 @echo ' ftp_upload upload the web site via FTP ' | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
39 @echo ' s3_upload upload the web site via S3 ' | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
40 @echo ' github upload the web site via gh-pages ' | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
41 @echo ' ' | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
42 | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
43 | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
44 html: clean $(OUTPUTDIR)/index.html | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
45 | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
46 $(OUTPUTDIR)/%.html: | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
47 $(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
48 | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
49 clean: | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
50 [ ! -d $(OUTPUTDIR) ] || find $(OUTPUTDIR) -mindepth 1 -delete | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
51 | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
52 regenerate: clean | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
53 $(PELICAN) -r $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
54 | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
55 serve: | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
56 cd $(OUTPUTDIR) && $(PY) -m pelican.server | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
57 | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
58 devserver: | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
59 $(BASEDIR)/develop_server.sh restart | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
60 | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
61 stopserver: | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
62 kill -9 `cat pelican.pid` | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
63 kill -9 `cat srv.pid` | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
64 @echo 'Stopped Pelican and SimpleHTTPServer processes running in background.' | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
65 | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
66 publish: | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
67 $(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(PUBLISHCONF) $(PELICANOPTS) | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
68 | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
69 ssh_upload: publish | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
70 scp -P $(SSH_PORT) -r $(OUTPUTDIR)/* $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
71 | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
72 rsync_upload: publish | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
73 rsync -e "ssh -p $(SSH_PORT)" -P -rvz --delete $(OUTPUTDIR)/ $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) --cvs-exclude | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
74 | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
75 dropbox_upload: publish | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
76 cp -r $(OUTPUTDIR)/* $(DROPBOX_DIR) | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
77 | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
78 ftp_upload: publish | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
79 lftp ftp://$(FTP_USER)@$(FTP_HOST) -e "mirror -R $(OUTPUTDIR) $(FTP_TARGET_DIR) ; quit" | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
80 | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
81 s3_upload: publish | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
82 s3cmd sync $(OUTPUTDIR)/ s3://$(S3_BUCKET) --acl-public --delete-removed | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
83 | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
84 github: publish | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
85 ghp-import $(OUTPUTDIR) | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
86 git push origin gh-pages | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
87 | 
| 
 
4cd9b65e10e4
initial import of the pelican based blog
 
Dirk Olmes <dirk@xanthippe.ping.de> 
parents:  
diff
changeset
 | 
88 .PHONY: html help clean regenerate serve devserver publish ssh_upload rsync_upload dropbox_upload ftp_upload s3_upload github | 
