forked from ThreeDotsLabs/wild-workouts-go-ddd-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
64 lines (52 loc) · 2.74 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
include .env
export
.PHONY: openapi
openapi: openapi_http openapi_js
.PHONY: openapi_http
openapi_http:
oapi-codegen -generate types -o internal/trainings/ports/openapi_types.gen.go -package ports api/openapi/trainings.yml
oapi-codegen -generate chi-server -o internal/trainings/ports/openapi_api.gen.go -package ports api/openapi/trainings.yml
oapi-codegen -generate types -o internal/common/client/trainings/openapi_types.gen.go -package trainings api/openapi/trainings.yml
oapi-codegen -generate client -o internal/common/client/trainings/openapi_client_gen.go -package trainings api/openapi/trainings.yml
oapi-codegen -generate types -o internal/trainer/ports/openapi_types.gen.go -package ports api/openapi/trainer.yml
oapi-codegen -generate chi-server -o internal/trainer/ports/openapi_api.gen.go -package ports api/openapi/trainer.yml
oapi-codegen -generate types -o internal/common/client/trainer/openapi_types.gen.go -package trainer api/openapi/trainer.yml
oapi-codegen -generate client -o internal/common/client/trainer/openapi_client_gen.go -package trainer api/openapi/trainer.yml
oapi-codegen -generate types -o internal/users/openapi_types.gen.go -package main api/openapi/users.yml
oapi-codegen -generate chi-server -o internal/users/openapi_api.gen.go -package main api/openapi/users.yml
oapi-codegen -generate types -o internal/common/client/users/openapi_types.gen.go -package users api/openapi/users.yml
oapi-codegen -generate client -o internal/common/client/users/openapi_client_gen.go -package users api/openapi/users.yml
.PHONY: openapi_js
openapi_js:
docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli:v4.3.0 generate \
-i /local/api/openapi/trainings.yml \
-g javascript \
-o /local/web/src/repositories/clients/trainings
docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli:v4.3.0 generate \
-i /local/api/openapi/trainer.yml \
-g javascript \
-o /local/web/src/repositories/clients/trainer
docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli:v4.3.0 generate \
-i /local/api/openapi/users.yml \
-g javascript \
-o /local/web/src/repositories/clients/users
.PHONY: proto
proto:
protoc --go_out=plugins=grpc:internal/common/genproto/trainer -I api/protobuf api/protobuf/trainer.proto
protoc --go_out=plugins=grpc:internal/common/genproto/users -I api/protobuf api/protobuf/users.proto
.PHONY: lint
lint:
@./scripts/lint.sh trainer
@./scripts/lint.sh trainings
@./scripts/lint.sh users
.PHONY: fmt
fmt:
goimports -l -w internal/
.PHONY: mycli
mycli:
mycli -u ${MYSQL_USER} -p ${MYSQL_PASSWORD} ${MYSQL_DATABASE}
test:
@./scripts/test.sh common .e2e.env
@./scripts/test.sh trainer .test.env
@./scripts/test.sh trainings .test.env
@./scripts/test.sh users .test.env