Skip to content

Commit

Permalink
refactor use of docker
Browse files Browse the repository at this point in the history
Co-authored-by: Allen Lee <[email protected]>
  • Loading branch information
fmichonneau and alee committed Dec 13, 2019
1 parent 0b6797e commit 116d5b9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ _site
.Rhistory
.RData
.vendor/
.docker-vendor/
Gemfile.lock
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# Settings
MAKEFILES=Makefile $(wildcard *.mk)
JEKYLL_VERSION=3.8.5
JEKYLL_DOCKER=${JEKYLL} serve --host 0.0.0.0
JEKYLL=bundle install --path .vendor/bundle && bundle update && bundle exec jekyll
PARSER=bin/markdown_ast.rb
DST=_site
Expand Down Expand Up @@ -44,7 +43,11 @@ commands :

## docker-serve : use docker to build the site
docker-serve :
docker run --rm -it -v ${PWD}:/srv/jekyll -p 4000:4000 jekyll/jekyll:${JEKYLL_VERSION} ${JEKYLL_DOCKER}
docker run --rm -it --volume ${PWD}:/srv/jekyll \
--volume=${PWD}/.docker-vendor/bundle:/usr/local/bundle \
-p 127.0.0.1:4000:4000 \
jekyll/jekyll:${JEKYLL_VERSION} \
bin/run-make-docker-serve.sh

## serve : run a local server.
serve : lesson-md
Expand Down
1 change: 1 addition & 0 deletions bin/boilerplate/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ exclude:
- bin/
- .Rproj.user/
- .vendor/
- .docker-vendor/

# Turn on built-in syntax highlighting.
highlighter: rouge
10 changes: 10 additions & 0 deletions bin/run-make-docker-serve.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

set -o errexit
set -o pipefail
set -o nounset


bundle install
bundle update
exec bundle exec jekyll serve --host 0.0.0.0

0 comments on commit 116d5b9

Please sign in to comment.