1
- pwd := $( CURDIR )
2
- cmd := ""
1
+ cmd := "version"
2
+ opt := ""
3
3
DOCKER_COMPOSE := docker compose
4
4
GH_USER_ID := peaceiris
5
-
5
+ HUGO_VERSION := $(shell cd ./deps && go mod edit -json | jq -r '.Require[] | select(.Path == "github.com/gohugoio/hugo") | .Version | split("v") | .[1]')
6
+ GO_VERSION := $(shell cd ./deps && go mod edit -json | jq -r '.Go')
6
7
7
8
.PHONY : bump-node
8
9
bump-node :
9
10
bash scripts/bump_node.sh
10
11
11
12
.PHONY : npm-ci
12
13
npm-ci :
14
+ cd ./exampleSite && \
13
15
npm ci
14
16
15
17
.PHONY : docker-dev
16
- docker-dev : npm-ci
17
- $(eval opt := server --navigateToChanged -- bind=0.0.0.0 --buildDrafts )
18
- export HUGO_VERSION=$( shell make get-hugo-version) && \
18
+ docker-dev :
19
+ $(eval opt := -- bind=0.0.0.0)
20
+ export HUGO_VERSION=${HUGO_VERSION} && \
19
21
$(DOCKER_COMPOSE ) up -d && \
20
- $(DOCKER_COMPOSE ) exec hugo hugo $(opt )
22
+ $(DOCKER_COMPOSE ) exec hugo make dev opt=$(opt ) || \
23
+ $(DOCKER_COMPOSE ) down
21
24
22
25
.PHONY : docker-hugo
23
- docker-hugo : npm-ci
24
- # make docker-hugo cmd="version"
25
- export HUGO_VERSION=$( shell make get-hugo-version) && \
26
+ docker-hugo :
27
+ @echo ' usage: make docker-hugo cmd="version"'
28
+ export HUGO_VERSION=${HUGO_VERSION} && \
26
29
$(DOCKER_COMPOSE ) run --rm --entrypoint=hugo hugo $(cmd )
27
30
28
31
.PHONY : docker-build
29
- docker-build : npm-ci
30
- $(eval opt := --minify --cleanDestinationDir)
31
- export HUGO_VERSION=$(shell make get-hugo-version) && \
32
- $(DOCKER_COMPOSE ) run --rm --entrypoint=hugo hugo $(opt )
32
+ docker-build :
33
+ export HUGO_VERSION=${HUGO_VERSION} && \
34
+ $(DOCKER_COMPOSE ) run --rm --entrypoint=make hugo build-prod
33
35
34
36
.PHONY : docker-test
35
- docker-test : npm-ci
36
- $(eval opt := --minify --renderToMemory --printPathWarnings --debug \
37
- --templateMetrics --templateMetricsHints)
38
- export HUGO_VERSION=$(shell make get-hugo-version) && \
39
- $(DOCKER_COMPOSE ) run --rm --entrypoint=hugo hugo $(opt )
40
-
41
- .PHONY : npm-ci
42
- npm-ci :
43
- cd ./exampleSite && \
44
- npm ci
37
+ docker-test :
38
+ export HUGO_VERSION=${HUGO_VERSION} && \
39
+ $(DOCKER_COMPOSE ) run --rm --entrypoint=make hugo test
45
40
46
41
.PHONY : dev
47
- dev : npm-ci
42
+ dev :
48
43
cd ./exampleSite && \
49
- hugo server --renderStaticToDisk --navigateToChanged --buildDrafts
44
+ hugo server --renderStaticToDisk --navigateToChanged --buildDrafts $( opt )
50
45
51
46
.PHONY : test
52
- test : npm-ci
47
+ test :
53
48
cd ./exampleSite && \
54
- hugo --minify --renderToMemory --printPathWarnings --debug \
55
- --templateMetrics --templateMetricsHints
49
+ hugo --minify --debug --renderToMemory \
50
+ --templateMetrics --templateMetricsHints \
51
+ --printPathWarnings --printUnusedTemplates
56
52
57
53
.PHONY : build-staging
58
- build-staging : npm-ci
54
+ build-staging :
59
55
cd ./exampleSite && \
60
- hugo --minify --cleanDestinationDir \
56
+ hugo --minify --debug -- cleanDestinationDir \
61
57
--environment " staging" \
62
- --printPathWarnings --debug \
63
- --templateMetrics --templateMetricsHints
58
+ --templateMetrics --templateMetricsHints \
59
+ --printPathWarnings --printUnusedTemplates
64
60
65
61
.PHONY : build-prod
66
- build-prod : npm-ci
62
+ build-prod :
67
63
cd ./exampleSite && \
68
64
hugo --minify --cleanDestinationDir --printPathWarnings && \
69
65
wget -O ./public/report.html ${BASE_URL} /report.html || true
@@ -76,8 +72,8 @@ fetch-data:
76
72
77
73
.PHONY : get-go-version
78
74
get-go-version :
79
- @cd ./deps && go mod edit -json | jq -r ' .Go '
75
+ @echo ${GO_VERSION}
80
76
81
77
.PHONY : get-hugo-version
82
78
get-hugo-version :
83
- @cd ./deps && go mod edit -json | jq -r ' .Require[] | select(.Path == "github.com/gohugoio/hugo") | .Version | split("v") | .[1] '
79
+ @echo ${HUGO_VERSION}
0 commit comments