comparison Makefile @ 0:c4ec6945bb86

Just ran pelican-quickstart and answered some questions. Created .hgignore file.
author Brian Neal <bgneal@gmail.com>
date Wed, 29 Jan 2014 18:53:45 -0600
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:c4ec6945bb86
1 PY=python
2 PELICAN=pelican
3 PELICANOPTS=
4
5 BASEDIR=$(CURDIR)
6 INPUTDIR=$(BASEDIR)/content
7 OUTPUTDIR=$(BASEDIR)/output
8 CONFFILE=$(BASEDIR)/pelicanconf.py
9 PUBLISHCONF=$(BASEDIR)/publishconf.py
10
11 FTP_HOST=localhost
12 FTP_USER=anonymous
13 FTP_TARGET_DIR=/
14
15 SSH_HOST=jaguar
16 SSH_PORT=22
17 SSH_USER=brian
18 SSH_TARGET_DIR=/svr/www/deathofagremmie.com/public
19
20 S3_BUCKET=my_s3_bucket
21
22 CLOUDFILES_USERNAME=my_rackspace_username
23 CLOUDFILES_API_KEY=my_rackspace_api_key
24 CLOUDFILES_CONTAINER=my_cloudfiles_container
25
26 DROPBOX_DIR=~/Dropbox/Public/
27
28 DEBUG ?= 0
29 ifeq ($(DEBUG), 1)
30 PELICANOPTS += -D
31 endif
32
33 help:
34 @echo 'Makefile for a pelican Web site '
35 @echo ' '
36 @echo 'Usage: '
37 @echo ' make html (re)generate the web site '
38 @echo ' make clean remove the generated files '
39 @echo ' make regenerate regenerate files upon modification '
40 @echo ' make publish generate using production settings '
41 @echo ' make serve [PORT=8000] serve site at http://localhost:8000'
42 @echo ' make devserver [PORT=8000] start/restart develop_server.sh '
43 @echo ' make stopserver stop local server '
44 @echo ' make ssh_upload upload the web site via SSH '
45 @echo ' make rsync_upload upload the web site via rsync+ssh '
46 @echo ' make dropbox_upload upload the web site via Dropbox '
47 @echo ' make ftp_upload upload the web site via FTP '
48 @echo ' make s3_upload upload the web site via S3 '
49 @echo ' make cf_upload upload the web site via Cloud Files'
50 @echo ' make github upload the web site via gh-pages '
51 @echo ' '
52 @echo 'Set the DEBUG variable to 1 to enable debugging, e.g. make DEBUG=1 html'
53 @echo ' '
54
55 html:
56 $(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
57
58 clean:
59 [ ! -d $(OUTPUTDIR) ] || rm -rf $(OUTPUTDIR)
60
61 regenerate:
62 $(PELICAN) -r $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
63
64 serve:
65 ifdef PORT
66 cd $(OUTPUTDIR) && $(PY) -m pelican.server $(PORT)
67 else
68 cd $(OUTPUTDIR) && $(PY) -m pelican.server
69 endif
70
71 devserver:
72 ifdef PORT
73 $(BASEDIR)/develop_server.sh restart $(PORT)
74 else
75 $(BASEDIR)/develop_server.sh restart
76 endif
77
78 stopserver:
79 kill -9 `cat pelican.pid`
80 kill -9 `cat srv.pid`
81 @echo 'Stopped Pelican and SimpleHTTPServer processes running in background.'
82
83 publish:
84 $(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(PUBLISHCONF) $(PELICANOPTS)
85
86 ssh_upload: publish
87 scp -P $(SSH_PORT) -r $(OUTPUTDIR)/* $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR)
88
89 rsync_upload: publish
90 rsync -e "ssh -p $(SSH_PORT)" -P -rvz --delete $(OUTPUTDIR)/ $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) --cvs-exclude
91
92 dropbox_upload: publish
93 cp -r $(OUTPUTDIR)/* $(DROPBOX_DIR)
94
95 ftp_upload: publish
96 lftp ftp://$(FTP_USER)@$(FTP_HOST) -e "mirror -R $(OUTPUTDIR) $(FTP_TARGET_DIR) ; quit"
97
98 s3_upload: publish
99 s3cmd sync $(OUTPUTDIR)/ s3://$(S3_BUCKET) --acl-public --delete-removed
100
101 cf_upload: publish
102 cd $(OUTPUTDIR) && swift -v -A https://auth.api.rackspacecloud.com/v1.0 -U $(CLOUDFILES_USERNAME) -K $(CLOUDFILES_API_KEY) upload -c $(CLOUDFILES_CONTAINER) .
103
104 github: publish
105 ghp-import $(OUTPUTDIR)
106 git push origin gh-pages
107
108 .PHONY: html help clean regenerate serve devserver publish ssh_upload rsync_upload dropbox_upload ftp_upload s3_upload cf_upload github