-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I always have dependency problems when using Ruby based tools such as Jekyll. This would have saved me a lot of time, and maybe it will save others time in the future.
- Loading branch information
1 parent
e019fd9
commit b9803dc
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
set -u | ||
|
||
# Either run Jekyll interactively, or build the site statically, using a Docker | ||
# container. | ||
# | ||
# This is based on the official Jekyll Docker images: | ||
# | ||
# https://github.com/envygeeks/jekyll-docker/blob/master/README.md | ||
|
||
USAGE="sh ./build.sh [serve|build]" | ||
|
||
if [ $# -ne 1 ] ; then | ||
echo "$USAGE" 1>&2 | ||
exit 1 | ||
fi | ||
|
||
cd "$(dirname "$0")" | ||
export JEKYLL_VERSION=3.8 | ||
|
||
if [ "$1" = "serve" ] ; then | ||
docker run --rm \ | ||
-p 4000:4000 \ | ||
--volume="$PWD:/srv/jekyll" \ | ||
-it jekyll/jekyll:$JEKYLL_VERSION \ | ||
jekyll serve | ||
elif [ "$1" = "build" ] ; then | ||
docker run --rm \ | ||
--volume="$PWD:/srv/jekyll" \ | ||
-it jekyll/jekyll:$JEKYLL_VERSION \ | ||
jekyll build | ||
else | ||
echo "$USAGE" 1>&2 | ||
exit 1 | ||
fi | ||
|