Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (52 loc) · 1.62 KB
/
Copy pathMakefile
File metadata and controls
60 lines (52 loc) · 1.62 KB
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
VERSION ?= $(shell git describe --tags --abbrev=0)
BUILD_DATE ?= $(shell date -u +'%Y%m%d-%H%M')
SCHEMA_DIR := src/types/godoxy
.PHONY: dev
dev:
docker compose up --build
commit-push:
pnpm format:write
git add .
git commit
git push
update-wiki:
cd public/wiki && git pull
test-run:
docker compose -f test-run.compose.yml up --build
gen-schema-single:
pnpx ts-json-schema-generator --minify --no-type-check -e all --no-ref-encode -f ./tsconfig.json -o "${SCHEMA_DIR}/${OUT}" -p "${SCHEMA_DIR}/${IN}" -t ${CLASS}
# minify
# python3 -c "import json; f=open('${SCHEMA_DIR}/${OUT}', 'r'); j=json.load(f); f.close(); f=open('${SCHEMA_DIR}/${OUT}', 'w'); json.dump(j, f, separators=(',', ':'));"
# deference
node ${SCHEMA_DIR}/deref.ts ${SCHEMA_DIR}/${OUT} > ${SCHEMA_DIR}/${OUT}.deref.json
mv ${SCHEMA_DIR}/${OUT}.deref.json ${SCHEMA_DIR}/${OUT}
gen-schema:
make IN=config/config.ts \
CLASS=Config \
OUT=config.schema.json \
gen-schema-single
make IN=providers/routes.ts \
CLASS=Routes \
OUT=routes.schema.json \
gen-schema-single
make IN=middlewares/middleware_compose.ts \
CLASS=MiddlewareCompose \
OUT=middleware_compose.schema.json \
gen-schema-single
make IN=middlewares/middleware_compose.ts \
CLASS=EntrypointMiddlewares \
OUT=entrypoint_middlewares.schema.json \
gen-schema-single
make IN=docker.ts \
CLASS=DockerRoutes \
OUT=docker_routes.schema.json \
gen-schema-single
make IN=config/acl.ts \
CLASS=ACLConfig \
OUT=acl.schema.json \
gen-schema-single
make IN=config/maxmind.ts \
CLASS=MaxmindConfig \
OUT=maxmind.schema.json \
gen-schema-single
pnpm format:write