-
Notifications
You must be signed in to change notification settings - Fork 204
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (27 loc) · 991 Bytes
/
Copy pathMakefile
File metadata and controls
35 lines (27 loc) · 991 Bytes
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
.PHONY: all build react-ui react-ui-force test clean docs-gen
all: build
# Skip the npm build when dist already exists, so repeated `make build`
# is fast. This intentionally reuses a stale dist — use react-ui-force
# in CI and releases where correctness matters more than speed.
react-ui:
ifneq ($(wildcard api/react-ui/dist),)
@echo "api/react-ui/dist already exists, skipping build"
else
cd api/react-ui && npm ci && npm run build
endif
# Always rebuild from source. Used by CI, goreleaser and Docker.
react-ui-force:
rm -rf api/react-ui/dist
cd api/react-ui && npm ci && npm run build
api/react-ui/dist: react-ui
build: api/react-ui/dist
go build -o edgevpn
test: api/react-ui/dist
go test ./...
# docs-gen regenerates the CLI and environment-variable reference from the real
# cli.App. The output is committed; CI re-runs this and fails on a diff, so the
# docs cannot drift from the binary.
docs-gen:
go run ./internal/docsgen
clean:
rm -rf api/react-ui/dist edgevpn