-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
86 lines (63 loc) · 2.03 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
DOCS_BASE_URL:=/
HUGO_VERSION:=0.117.0
default: lint frontend_lint test
build_prod: frontend_prod
go build \
-trimpath \
-mod=readonly \
-ldflags "-X main.version=$(shell git describe --tags --always || echo dev)"
lint:
golangci-lint run
publish: frontend_prod
bash ./ci/build.sh
short_test:
go test -cover -test.short -v ./...
test:
go test -cover -v ./...
# --- Editor frontend
frontend_prod: export NODE_ENV=production
frontend_prod: frontend
frontend: node_modules
node ci/build.mjs
frontend_lint: node_modules
./node_modules/.bin/eslint \
--ext .js,.vue \
--fix \
src
node_modules:
npm ci --include dev
# --- Tools
update_ua_list:
# User-Agents provided by https://www.useragents.me/
curl -sSf https://www.useragents.me/api | jq -r '.data[].ua' | grep -v 'Trident' >internal/linkcheck/user-agents.txt
gh-workflow:
bash ci/create-workflow.sh
# -- Vulnerability scanning --
trivy:
trivy fs . \
--dependency-tree \
--exit-code 1 \
--format table \
--ignore-unfixed \
--quiet \
--scanners misconfig,license,secret,vuln \
--severity HIGH,CRITICAL \
--skip-dirs docs
# -- Documentation Site --
docs: actor_docs eventclient_docs template_docs
actor_docs:
go run . --storage-conn-string $(shell mktemp).db actor-docs >docs/content/configuration/actors.md
template_docs:
go run . --storage-conn-string $(shell mktemp).db tpl-docs >docs/content/configuration/templating.md
eventclient_docs:
echo -e "---\ntitle: EventClient\nweight: 10000\n---\n" >docs/content/overlays/eventclient.md
docker run --rm -i -v $(CURDIR):$(CURDIR) -w $(CURDIR) node:18-alpine sh -ec 'npx --yes jsdoc-to-markdown --files ./internal/apimodules/overlays/default/eventclient.js' >>docs/content/overlays/eventclient.md
render_docs: hugo_$(HUGO_VERSION)
./hugo_$(HUGO_VERSION) \
--baseURL "$(DOCS_BASE_URL)" \
--cleanDestinationDir \
--gc \
--source docs
hugo_$(HUGO_VERSION):
curl -sSfL https://github.com/gohugoio/hugo/releases/download/v$(HUGO_VERSION)/hugo_extended_$(HUGO_VERSION)_linux-amd64.tar.gz | tar -xz hugo
mv hugo $@