-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
69 lines (54 loc) · 1.42 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
# OLD_VERSION=0.65.3
# OLD_VERSION=0.83.1
VERSION=0.101.0
# VERSION=0.110.0 # not released Docker image
PORT=1313
$(eval USER_ID := $(shell id -u $(USER)))
$(eval GROUP_ID := $(shell id -g $(USER)))
.PHONY: server
server:
docker run --rm -it \
-v $(PWD):/src \
-p $(PORT):1313 \
klakegg/hugo:$(VERSION) server
.PHONY: new
new:
@echo "Directory name is $(D)"
mkdir -p content/post/$(D)
docker run --rm -it \
-v /etc/group:/etc/group:ro \
-v /etc/passwd:/etc/passwd:ro \
-v $(PWD):/src \
-u $(USER_ID):$(GROUP_ID) \
klakegg/hugo:$(VERSION) new "content/post/$(D)/index.md"
code "content/post/$(D)/index.md";
.PHONY: scraps
scraps:
@echo "Directory name is $(D)"
mkdir -p content/scraps/$(D)
docker run --rm -it \
-v /etc/group:/etc/group:ro \
-v /etc/passwd:/etc/passwd:ro \
-v $(PWD):/src \
-u $(USER_ID):$(GROUP_ID) \
klakegg/hugo:$(VERSION) new "content/scraps/$(D)/index.md"
code "content/scraps/$(D)/index.md";
.PHONY: log
log:
@echo "Directory name is $(D)"
mkdir -p content/log/$(D)
docker run --rm -it \
-v /etc/group:/etc/group:ro \
-v /etc/passwd:/etc/passwd:ro \
-v $(PWD):/src \
-u $(USER_ID):$(GROUP_ID) \
klakegg/hugo:$(VERSION) new "content/log/$(D)/index.md"
code "content/log/$(D)/index.md";
.PHONY: build
build:
docker run --rm -it \
-v /etc/group:/etc/group:ro \
-v /etc/passwd:/etc/passwd:ro \
-v $(PWD):/src \
-u $(USER_ID):$(GROUP_ID) \
klakegg/hugo:$(VERSION)