-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
80 lines (68 loc) · 1.68 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
HUGO_VERSION ?= 0.82.0
HUGO_PORT ?= 1313
.PHONY: all
all: build
.PHONY: build
build:
hugo
.PHONY: bump-version-hugo
bump-version-hugo:
@echo "CONTRIBUTING.md"
@echo "content/projects/ntweb/index.es.md"
@echo "content/projects/ntweb/index.es.md"
@grep -lR "$(HUGO_VERSION)" . | \
grep -v "^\./\.git/" | \
grep -v "^\./\.mage/vendor/" | \
grep -v "^\./archetypes/" | \
grep -v "^\./assets/" | \
grep -v "^\./content/" | \
grep -v "^\./data/" | \
grep -v "^\./i18n/" | \
grep -v "^\./layouts/" | \
grep -v "^\./node_modules/" | \
grep -v "^\./themes/" | \
grep -v "^\./public/" | \
grep -v "^\./resources/" | \
grep -v "\.swp\$$"
.PHONY: clean
clean:
rm -rf public
.PHONY: run
run:
hugo server -DEF --noHTTPCache --i18n-warnings --disableFastRender \
--bind 0.0.0.0 --port $(HUGO_PORT) --baseUrl / --appendPort=false
##########
# Docker #
##########
DOCKER_IMAGE_TAG := $(HUGO_VERSION)-extended
.PHONY: docker-build
docker-build:
@docker run --rm -it \
-u $$(id -u $$USER) \
-v "$${TMPDIR:-/tmp}":/tmp/ \
-v "$$PWD":/site/ \
ntrrg/hugo:$(DOCKER_IMAGE_TAG)
.PHONY: docker-run
docker-run:
@docker run --rm -it \
-e PORT=$(HUGO_PORT) \
-p $(HUGO_PORT):$(HUGO_PORT) \
-u $$(id -u $$USER) \
-v "$${TMPDIR:-/tmp}":/tmp/ \
-v "$$PWD":/site/ \
ntrrg/hugo:$(DOCKER_IMAGE_TAG) server -DEF --noHTTPCache --i18n-warnings \
--disableFastRender \
--bind 0.0.0.0 --port $(HUGO_PORT) --baseUrl / --appendPort=false
.PHONY: docker-shell
docker-shell:
@docker run --rm -it \
-u $$(id -u $$USER) \
-v "$${TMPDIR:-/tmp}":/tmp/ \
-v "$$PWD":/site/ \
--entrypoint sh \
ntrrg/hugo:$(DOCKER_IMAGE_TAG)
########
# Make #
########
# Disable parallelism
.NOTPARALLEL: