-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (49 loc) · 1.39 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
# Run tests
test: gen-rest
@echo "==> Running tests"
@go test -cover ./... | grep -e "^[^?].*"
@echo "==> Complete"
.PHONY: test
# Release binaries to GitHub
release:
@echo "==> Releasing"
@goreleaser -p 1 --rm-dist --config .goreleaser.yaml
@echo "==> Complete"
.PHONY: release
# Pre release to debug locally
pre-release:
@echo "==> Releasing to locals"
@goreleaser release --snapshot --rm-dist
@echo "==> Complete"
.PHONY: pre-release
# Run tests with hotreload
watch-tests:
@watch -n 2 make test
.PHONY: watch-tests
# Generate rest stub
gen-rest:
@echo "==> Generating rest server stub"
@oapi-codegen --config ./src/web/server/.codegen.server.yaml ./src/web/server/.openapi.yaml
.PHONY: gen-rest
# Run deamon with hot reload
hot-deamon:
@air -build.cmd "go build -o ./tmp/main ./src/bin/daemon/main.go"
.PHONY: hot-deamon
# Run deamon
deamon:
@go run src/bin/daemon/main.go
.PHONY: deamon
# Run frontend
front:
@cd frog-db-frontend; yarn build-prod; yarn start
.PHONY: deamon
# Generate frogdb frontend api sdk
frontend-sdk-gen:
@docker run --rm \
-v ${PWD}:/local openapitools/openapi-generator-cli generate \
-i /local/src/web/server/.openapi.yaml \
-g typescript-axios \
-o /local/frog-db-frontend/src/apiCodegen
# delete all files but with .ts extension
@cd ./frog-db-frontend/src/apiCodegen/; find . -not -name '*ts' -print0 | xargs -0 -I {} rm -r {}
.PHONY: frontend-sdk-gen