Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Makefile - github.com/peaceiris/hugo-theme-iris.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a15a340007cd8b7620e055da149abf30adf16e0d (plain)
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
pwd := $(CURDIR)
cmd := ""
DOCKER_COMPOSE := docker compose
GH_USER_ID := peaceiris


.PHONY: bump-node
bump-node:
	bash scripts/bump_node.sh

.PHONY: docker-dev
docker-dev: npm-ci
	$(eval opt := server --navigateToChanged --bind=0.0.0.0 --buildDrafts)
	export HUGO_VERSION=v$(shell make get-hugo-version) && \
	$(DOCKER_COMPOSE) up -d && \
	$(DOCKER_COMPOSE) exec hugo hugo $(opt)

.PHONY: docker-hugo
docker-hugo: npm-ci
	# make docker-hugo cmd="version"
	export HUGO_VERSION=v$(shell make get-hugo-version) && \
	$(DOCKER_COMPOSE) run --rm --entrypoint=hugo hugo $(cmd)

.PHONY: docker-build
docker-build: npm-ci
	$(eval opt := --minify --cleanDestinationDir)
	export HUGO_VERSION=v$(shell make get-hugo-version) && \
	$(DOCKER_COMPOSE) run --rm --entrypoint=hugo hugo $(opt)

.PHONY: docker-test
docker-test: npm-ci
	$(eval opt := --minify --renderToMemory --printPathWarnings --debug \
		--templateMetrics --templateMetricsHints)
	export HUGO_VERSION=v$(shell make get-hugo-version) && \
	$(DOCKER_COMPOSE) run --rm --entrypoint=hugo hugo $(opt)

.PHONY: npm-ci
npm-ci:
	cd ./exampleSite && \
	npm ci

.PHONY: dev
dev: npm-ci
	cd ./exampleSite && \
	hugo server --renderStaticToDisk --navigateToChanged --buildDrafts

.PHONY: test
test: npm-ci
	cd ./exampleSite && \
	hugo --minify --renderToMemory --printPathWarnings --debug \
		--templateMetrics --templateMetricsHints

.PHONY: build-staging
build-staging: npm-ci
	cd ./exampleSite && \
	hugo --minify --cleanDestinationDir \
		--environment "staging" \
		--printPathWarnings --debug \
		--templateMetrics --templateMetricsHints

.PHONY: build-prod
build-prod: npm-ci
	cd ./exampleSite && \
	hugo --minify --cleanDestinationDir --printPathWarnings && \
	wget -O ./public/report.html ${BASE_URL}/report.html || true

.PHONY: fetch-data
fetch-data:
	cd ./exampleSite && \
	bash ./scripts/fetch_data.sh ${GH_USER_ID} > ./data/github/${GH_USER_ID}.json && \
	deno run --allow-net --allow-read --allow-write --unstable scripts/fetch_images.ts

.PHONY: get-go-version
get-go-version:
	@cd ./deps && go mod edit -json | jq -r '.Go'

.PHONY: get-hugo-version
get-hugo-version:
	@cd ./deps && go mod edit -json | jq -r '.Require[] | select(.Path == "github.com/gohugoio/hugo") | .Version | split("v") | .[1]'