forked from openshift-evangelists/kbe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (54 loc) · 1.4 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/make -f
SHELL=/bin/bash
HUGO_IMAGE=docker.io/klakegg/hugo:ext-asciidoctor
HUGO_NAME=hugo-kbe
HUGO_ENV=development
HUGO_THEME=beautifulhugo
BIND_HOST?=0.0.0.0
BIND_PORT?=1313
# SITE_REPO=https://github.com/openshift-evangelists/kbe.git
SITE_REPO=https://github.com/tonejito/kbe.git
# SITE_URL=http://kubernetesbyexample.com/
SITE_URL=https://tonejito.github.io/kbe/
SITE_BRANCH=gh-pages
SITE_DIR=public/
HUGO_ARGS=\
--environment ${HUGO_ENV} \
--debug --verbose --log --verboseLog --logFile /dev/fd/2 \
--bind ${BIND_HOST} --port ${BIND_PORT} \
--theme ${HUGO_THEME} \
--buildDrafts --buildExpired --buildFuture \
--noHTTPCache --ignoreCache \
--disableFastRender
default: container
install:
brew install hugo
# snap install hugo --channel=extended
run:
hugo server \
${HUGO_ARGS} --renderToDisk \
;
container:
-docker rm ${HUGO_NAME}
docker run \
-it --rm --name ${HUGO_NAME} \
-v $(CURDIR):/src \
-p ${BIND_PORT}:${BIND_PORT} \
${HUGO_IMAGE} \
server \
${HUGO_ARGS} \
;
release:
git submodule add -f -b ${SITE_BRANCH} ${SITE_REPO} ${SITE_DIR}
docker run \
-it --rm --name ${HUGO_NAME}-release \
-v $(CURDIR):/src \
${HUGO_IMAGE} \
--baseURL ${SITE_URL} --theme ${HUGO_THEME} \
--buildDrafts --buildExpired --buildFuture
$(MAKE) -C public -f ../Makefile do_release
do_release:
git add --all
git status
git commit
git push -u origin ${SITE_BRANCH}