forked from github/pages-gem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (30 loc) · 834 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
DOCKER=docker
TAG=gh-pages
# Build the docker image
image:
${DOCKER} build -t ${TAG} .
image_alpine:
${DOCKER} build -t ${TAG} . -f Dockerfile.alpine
# Produce a bash shell
shell:
${DOCKER} run --rm -it \
-p 4000:4000 \
-u `id -u`:`id -g` \
-v ${PWD}:/src/gh/pages-gem \
${TAG} \
/bin/bash
# Spawn a server. Specify the path to the SITE directory by
# exposing it using `expose SITE="../path-to-jekyll-site"` prior to calling or
# by prepending it to the make rule e.g.: `SITE=../path-to-site make server`
server:
test -d "${SITE}" || \
(echo -E "specify SITE e.g.: SITE=/path/to/site make server"; exit 1) && \
${DOCKER} run --rm -it \
-p 4000:4000 \
-u `id -u`:`id -g` \
-v ${PWD}:/src/gh/pages-gem \
-v `realpath ${SITE}`:/src/site \
-w /src/site \
${TAG}
.PHONY:
image image_alpine server shell