-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
77 lines (56 loc) · 1.64 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
FRONTEND_DIR = './web/app'
setup: setup-frontend setup-backend
setup-frontend:
@cd $(FRONTEND_DIR) && yarn
setup-backend: mod
mod:
@go mod download
env: env-local
env-local:
@cp .env .env.local
clean:
@rm -rf $(FRONTEND_DIR)/build \
$(FRONTEND_DIR)/dist \
$(FRONTEND_DIR)/*.tsbuildinfo \
reports
generate: generate-backend generate-frontend
generate-frontend:
@docker compose up --remove-orphans --build -d openapi-client
@rm -rf web/app/src/api/generated && true
@docker compose cp openapi-client:/out web/app/src/api/generated
@docker compose stop openapi-client
generate-backend:
@docker compose up --remove-orphans --build -d openapi-server
@rm -rf internal/app/generated && true
@docker compose cp openapi-server:/out internal/app/generated
@docker compose stop openapi-server
build: build-backend build-frontend
build-backend:
@mkdir -p ./build
@go build -v -o ./build/pinman main.go
build-frontend:
@cd $(FRONTEND_DIR) && yarn build
run: clean generate build-frontend
@SPA_PATH=./web/app/dist ENV_FILE=.env.local go run main.go
run-backend:
@ENV_FILE=.env.local go run main.go
run-frontend:
@cd $(FRONTEND_DIR) && VITE_API_HOST=http://localhost:8080/api yarn start
test: test-backend test-frontend
test-setup:
@go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo
test-frontend:
@cd $(FRONTEND_DIR) && yarn test
@rm -rf ./reports/ts && true
@mkdir -p ./reports/ts
@mv -f $(FRONTEND_DIR)/reports/* ./reports/ts
test-backend: test-setup
@ginkgo ./...
test-backend-cov: test-setup
@ginkgo --cover \
--race \
--json-report=report.json \
--output-dir=reports/go \
--skip-package generated \
--skip-file mock \
./...