add docker-serve make target for #238
authorAllen Lee <allen.lee@asu.edu>
Tue, 8 May 2018 16:11:58 +0000 (09:11 -0700)
committerAllen Lee <allen.lee@asu.edu>
Tue, 8 May 2018 16:20:50 +0000 (09:20 -0700)
If Docker is installed, `make docker-serve` will download and start a
Jekyll container to build and serve the site with hot reloading.

JEKYLL_VERSION should be synced with https://pages.github.com/versions/

Makefile

index df31f00cfc7ad62b0afc849061a287392998f06c..9d874013fa4c9696f89b90d6b67bf6c5a519e11e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,7 @@
 # Settings
 MAKEFILES=Makefile $(wildcard *.mk)
 JEKYLL=jekyll
+JEKYLL_VERSION=3.7.3
 PARSER=bin/markdown_ast.rb
 DST=_site
 
@@ -16,6 +17,10 @@ all : commands
 commands :
        @grep -h -E '^##' ${MAKEFILES} | sed -e 's/## //g'
 
+## docker-serve     : use docker to build the site
+docker-serve :
+       docker run --rm -it -v ${PWD}:/srv/jekyll -p 127.0.0.1:4000:4000 jekyll/jekyll:${JEKYLL_VERSION} make serve
+
 ## serve            : run a local server.
 serve : lesson-md
        ${JEKYLL} serve