forked from vectordotdev/vector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
100 lines (74 loc) · 2.35 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
CUE = ./scripts/cue.sh
# Override to specify which network address to use in Hugo/HTTP servers for binding
export SERVER_BIND ?= 127.0.0.1
# Override to specify which port to use in Hugo/HTTP servers for listening
export SERVER_PORT ?= 1313
clean:
rm -rf public resources data/cargo-lock.toml data/docs.json
setup:
yarn
# Copy Cargo data such as the dependency information file
cargo-data:
cp -f ../Cargo.lock data/cargo-lock.toml
# Build JSON from CUE sources
cue-build:
${CUE} build
# Other CUE commands
cue-check:
${CUE} check
cue-fmt:
${CUE} fmt
cue-help:
${CUE} help
cue-list:
${CUE} list
cue-vet:
${CUE} vet
config-examples:
yarn config-examples
structured-data: cue-build config-examples
serve: clean setup cargo-data structured-data
hugo server \
--bind $(SERVER_BIND) \
--port $(SERVER_PORT) \
--buildDrafts \
--buildFuture \
--environment "development"
# Live site
production-build:
hugo \
--environment "production" \
--minify
ci-production-build: setup cargo-data structured-data production-build run-link-checker algolia
# Preview site
preview-build:
hugo \
$(if $(DEPLOY_PRIME_URL),--baseURL $(DEPLOY_PRIME_URL),) \
--buildFuture \
--environment "preview" \
--minify
cp ./custom-headers/_preview ./public/_headers
ci-preview-build: setup cargo-data structured-data preview-build run-link-checker algolia
run-link-checker:
htmltest
run-external-link-checker:
htmltest --conf ./.htmltest.external.yml
# Check links without rebuilding the CUE sources. Optimal for fixing links locally.
check-links: production-build run-link-checker
# Search
algolia:
yarn algolia-config
yarn algolia-index
yarn algolia-upload
# Useful for locally debugging issues that arise only on the deployed production site
run-production-site-locally:
make setup cargo-data structured-data production-build
python3 -m http.server $(SERVER_PORT) --bind $(SERVER_BIND) --directory ./public
# Local dev build with no link checking and no Yarn dependency fetching
quick-build: clean cargo-data structured-data production-build
# Full local builds without Algolia updates (for debugging, link checking, etc.)
local-production-build: clean setup cargo-data structured-data production-build run-link-checker
local-preview-build: clean setup cargo-data structured-data preview-build run-link-checker
# Generate Lighthouse scores locally
lighthouse-report:
yarn lighthouse