-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathwatch.sh
More file actions
23 lines (20 loc) · 696 Bytes
/
watch.sh
File metadata and controls
23 lines (20 loc) · 696 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env bash
# Description : launch watch mode from jekyll without install ruby or gem
# Howto :
# run ./watch.sh in current directory with a number port (default: 4000)
# open browser http://localhost:4000
# CTRL^C to exit
# required : Docker
# source : https://github.com/envygeeks/jekyll-docker/blob/master/README.md
echo "$0 [port]"
export _JEKYLL_VERSION="${JEKYLL_VERSION:-3.8}"
export _JEKYLL_PORT=${1:-4000}
docker run --rm \
-it \
--ipc=host \
--net=host \
--publish ${_JEKYLL_PORT}:${_JEKYLL_PORT} \
--volume="${PWD}:/srv/jekyll:Z" \
--volume="${PWD}/vendor:/usr/local/bundle:Z" \
jekyll/jekyll:${_JEKYLL_VERSION} \
jekyll serve --port ${_JEKYLL_PORT} --watch