2017-06-26 19:57:02 +00:00
|
|
|
### Build and deploy http://kieranhealy.org
|
|
|
|
|
|
|
|
### If you want to use this file as-is, then you
|
|
|
|
### need to change the variables below to your
|
|
|
|
### own SSH user, document root, etc.
|
|
|
|
### However, you will most likely also want to
|
|
|
|
### customize the various steps (e.g. the css target)
|
|
|
|
### so that it matches the details of your own
|
|
|
|
### setup.
|
|
|
|
###
|
|
|
|
### Apart from hugo, you will also need rsync to deploy
|
|
|
|
### the site, and the java-based yuicompressor to
|
|
|
|
### minify the CSS, should you keep that step.
|
|
|
|
|
|
|
|
|
2017-06-27 15:46:06 +00:00
|
|
|
SSH_USER = jeremyki@jeremykidwell.info
|
|
|
|
STAGING_USER =
|
|
|
|
DOCUMENT_ROOT = /home/jeremyki/public_html
|
|
|
|
STAGING_ROOT = ~/public/gits/jeremykidwell.info
|
2017-06-26 19:57:02 +00:00
|
|
|
PUBLIC_DIR = public/
|
2017-06-27 15:46:06 +00:00
|
|
|
HUGO_EXECUTABLE = /usr/local/bin/hugo
|
|
|
|
|
|
|
|
|
2017-06-26 19:57:02 +00:00
|
|
|
|
|
|
|
all: deploy
|
|
|
|
|
|
|
|
staging: site
|
|
|
|
rsync -crzve 'ssh -p 22' $(PUBLIC_DIR) $(STAGING_USER):$(STAGING_ROOT)
|
|
|
|
|
|
|
|
server: css
|
2017-06-27 15:46:06 +00:00
|
|
|
/usr/local/bin/hugo server -ws .
|
|
|
|
|
|
|
|
rsync:
|
|
|
|
rsync -crzve 'ssh -p 22' $(PUBLIC_DIR) $(SSH_USER):$(DOCUMENT_ROOT)
|
2017-06-26 19:57:02 +00:00
|
|
|
|
|
|
|
deploy: compress site
|
|
|
|
rsync -crzve 'ssh -p 22' $(PUBLIC_DIR) $(SSH_USER):$(DOCUMENT_ROOT)
|
|
|
|
|
|
|
|
compress: css
|
2017-06-27 15:46:06 +00:00
|
|
|
yuicompressor static/css/stylesheet.css -o static/css/stylesheet-min.css --charset utf-8
|
2017-06-26 19:57:02 +00:00
|
|
|
|
|
|
|
site: css .FORCE
|
2017-06-27 15:46:06 +00:00
|
|
|
$(HUGO_EXECUTABLE)
|
|
|
|
find $(PUBLIC_DIR) -type d -print0 | xargs -0 chmod 755
|
|
|
|
find $(PUBLIC_DIR) -type f -print0 | xargs -0 chmod 644
|
2017-06-26 19:57:02 +00:00
|
|
|
|
|
|
|
css:
|
|
|
|
touch static/css/stylesheet.css
|
|
|
|
rm -f static/css/stylesheet.css
|
|
|
|
cat static/css/kube.css static/css/demo.css static/css/syntax.css static/css/bigfoot-default.css > static/css/stylesheet.css
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf public/
|
|
|
|
|
2017-06-27 15:46:06 +00:00
|
|
|
.FORCE:
|